Skip to content

Commit 47d9ca2

Browse files
committed
Update inputPixelEditor.ts
1 parent 9a835b8 commit 47d9ca2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/pg/inputPixelEditor/inputPixelEditor.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -263,18 +263,18 @@ export default class PgInputPixelEditor extends HTMLElement {
263263
}
264264
const totalSize = this.size + this.gridSize;
265265
// Edit Layer
266-
this.#editLayerContext.fillStyle = WHITE;
267-
this.#editLayerContext.fillRect(
268-
x * totalSize - (this.gridSize) + 1,
269-
y * totalSize - (this.gridSize) + 1,
270-
this.size + (this.gridSize * 2) - 2,
271-
this.size + (this.gridSize * 2) - 2
272-
);
273266
this.#context.clearRect(x * totalSize, y * totalSize, this.size, this.size);
274267
this.#editLayerContext.clearRect(x * totalSize, y * totalSize, this.size, this.size);
275268
this.#noEditLayerContext.clearRect(x * totalSize, y * totalSize, this.size, this.size);
276269
// Edit layer
277270
if (this.#colors[color][3] !== 0) {
271+
this.#editLayerContext.fillStyle = WHITE;
272+
this.#editLayerContext.fillRect(
273+
x * totalSize - (this.gridSize) + 1,
274+
y * totalSize - (this.gridSize) + 1,
275+
this.size + (this.gridSize * 2) - 2,
276+
this.size + (this.gridSize * 2) - 2
277+
);
278278
this.#editLayerContext.fillStyle = toColor(this.#colors[color]);
279279
this.#editLayerContext.fillRect(x * totalSize + 1, y * totalSize + 1, this.size - 2, this.size - 2);
280280
}

0 commit comments

Comments
 (0)