Commit 7964954a authored by Grant's avatar Grant
Browse files

add missing mobile click emitter

parent b09ddd13
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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);
      }
+2 −0
Original line number Diff line number Diff line
@@ -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})`);
  }

  /**