mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-03-21 03:30:42 +00:00
Update engine.ts
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user