Skip to content

Commit

Permalink
Merge pull request #162 from sbrin/fix_dot_layer
Browse files Browse the repository at this point in the history
Fix dot layer
  • Loading branch information
sbrin authored May 22, 2024
2 parents 77ad7d6 + 1e6cc06 commit fd7677f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/core/layers/dot.layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export class DotLayer extends RectangleLayer {
delete this.modifiers.w;
delete this.modifiers.h;
delete this.modifiers.fill;
delete this.modifiers.radius;
if (!this.features.hasRGBSupport) {
delete this.modifiers.color;
}
Expand All @@ -38,6 +39,16 @@ export class DotLayer extends RectangleLayer {
this.draw();
}

draw(): void {
const {dc, position, size} = this;
dc.clear();
dc.ctx.fillStyle = this.color;
dc.ctx.strokeStyle = this.color;
dc.ctx.beginPath();
dc.ctx.rect(position.x, position.y, size.x, size.y);
dc.ctx.fill();
}

updateBounds(): void {
this.bounds = new Rect(this.position, this.size.clone());
}
Expand Down

0 comments on commit fd7677f

Please sign in to comment.