Skip to content

Commit

Permalink
fix: don't set hover colour unless drawing hover
Browse files Browse the repository at this point in the history
  • Loading branch information
seleb committed May 24, 2021
1 parent d57dca1 commit 367cb42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ export default class Draw1Bit {
}
// hover
this.context.globalCompositeOperation = 'difference';
this.context.fillStyle = this.colorHover;
if (this.hovered && this.x >= 0 && this.y >= 0 && this.x < this.width && this.y < this.height && !this.locked[k(this.x, this.y)]) {
this.context.fillStyle = this.colorHover;
this.context.fillRect(this.x * r, this.y * r, 1 * r, 1 * r);
}
// gridlines
Expand Down

0 comments on commit 367cb42

Please sign in to comment.