From 0a04b42127b6aed5f173bc34fa94f702803f6a5e Mon Sep 17 00:00:00 2001 From: kpal Date: Mon, 18 Nov 2024 12:34:06 +0000 Subject: [PATCH] Added pointer capture when mouse is down --- scripts/camera-controls.mjs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/camera-controls.mjs b/scripts/camera-controls.mjs index c5bc6ee2470..2a48587e2d6 100644 --- a/scripts/camera-controls.mjs +++ b/scripts/camera-controls.mjs @@ -489,6 +489,7 @@ class CameraControls extends Script { if (!this._camera) { return; } + this._element.setPointerCapture(event.pointerId); this._pointerEvents.set(event.pointerId, event); const startTouchPan = this.enablePan && this._pointerEvents.size === 2; @@ -562,6 +563,7 @@ class CameraControls extends Script { * @param {PointerEvent} event - The pointer event. */ _onPointerUp(event) { + this._element.releasePointerCapture(event.pointerId); this._pointerEvents.delete(event.pointerId); if (this._pointerEvents.size < 2) { this._lastPinchDist = -1;