From 242fd56aecd84aca204b15291c515b64fc3ad253 Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Sun, 8 Feb 2026 22:23:38 +0900 Subject: [PATCH] Update engine.ts --- packages/frontend/src/utility/room/engine.ts | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/frontend/src/utility/room/engine.ts b/packages/frontend/src/utility/room/engine.ts index eb80d36cb0..e765d269e5 100644 --- a/packages/frontend/src/utility/room/engine.ts +++ b/packages/frontend/src/utility/room/engine.ts @@ -264,7 +264,28 @@ export class RoomEngine { //postProcess.colorCurves = curve; } + let isDragging = false; + + this.canvas.addEventListener('pointerdown', (ev) => { + this.canvas.setPointerCapture(ev.pointerId); + }); + + this.canvas.addEventListener('pointermove', (ev) => { + if (this.canvas.hasPointerCapture(ev.pointerId)) { + isDragging = true; + } + }); + + this.canvas.addEventListener('pointerup', (ev) => { + window.setTimeout(() => { + isDragging = false; + this.canvas.releasePointerCapture(ev.pointerId); + }, 0); + }); + this.canvas.addEventListener('click', (ev) => { + if (this.grabbing != null) return; + if (isDragging) return; const mesh = this.scene.pick(this.scene.pointerX, this.scene.pointerY)?.pickedMesh; if (mesh != null) { const oid = mesh.metadata.objectId;