Browse Source

OrbitControls: update state on pointer up (#27425)

Signed-off-by: Guilherme Avila <[email protected]>
Guilherme Avila 1 year ago
parent
commit
1cd56c46ba
1 changed files with 10 additions and 0 deletions
  1. 10 0
      examples/jsm/controls/OrbitControls.js

+ 10 - 0
examples/jsm/controls/OrbitControls.js

@@ -1058,6 +1058,16 @@ class OrbitControls extends EventDispatcher {
 
 
 			state = STATE.NONE;
 			state = STATE.NONE;
 
 
+			if ( pointers.length == 1 ) {
+
+				const pointerId = pointers[ 0 ];
+				const position = pointerPositions[ pointerId ];
+
+				// minimal placeholder event - allows state correction on pointer-up
+				onTouchStart( { pointerId: pointerId, pageX: position.x, pageY: position.y } );
+
+			}
+
 		}
 		}
 
 
 		function onMouseDown( event ) {
 		function onMouseDown( event ) {