Update engine.ts

This commit is contained in:
syuilo
2026-02-08 22:23:38 +09:00
parent a42fdee480
commit 242fd56aec

View File

@@ -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;