prevent duplicate writes
This commit is contained in:
parent
31aacbf52e
commit
afd5cd8441
@ -37,6 +37,12 @@ export class Canvas {
|
|||||||
|
|
||||||
const color = typeof pixel === 'string' ? storeHex(pixel) : pixel;
|
const color = typeof pixel === 'string' ? storeHex(pixel) : pixel;
|
||||||
const index = to1D(x, y, this.size);
|
const index = to1D(x, y, this.size);
|
||||||
|
|
||||||
|
// prevent duplicate writes
|
||||||
|
if (this._canvas[index] === color) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const record = {
|
const record = {
|
||||||
user,
|
user,
|
||||||
color,
|
color,
|
||||||
|
Loading…
Reference in New Issue
Block a user