add missing mobile click emitter

This commit is contained in:
Grant 2024-06-30 13:13:33 -06:00
parent b09ddd13b4
commit 7964954a0d
2 changed files with 14 additions and 0 deletions

View File

@ -412,6 +412,18 @@ export class PanZoom extends EventEmitter<PanZoomEvents> {
const dx = Math.abs(this.panning.x - touch.clientX);
const dy = Math.abs(this.panning.y - touch.clientY);
if (Date.now() - this.touch.lastTouch < 500 && dx < 5 && dy < 5) {
this.emit("click", {
clientX: touch.clientX,
clientY: touch.clientY,
button: "LCLICK",
alt: false,
shift: false,
ctrl: false,
meta: false,
});
}
if (Date.now() - this.touch.lastTouch > 500 && dx < 25 && dy < 25) {
this.emit("longPress", this.panning.x, this.panning.y);
}

View File

@ -355,6 +355,8 @@ class Canvas {
// maybe only update specific element?
// i don't think it needs to be awaited
await this.updateCanvasRedisAtPos(x, y);
Logger.info(`${user.sub} placed pixel at (${x}, ${y})`);
}
/**