Skip to content

Commit

Permalink
OrbitControls: update pointerUp (#27445)
Browse files Browse the repository at this point in the history
Signed-off-by: Guilherme Avila <3927951+sciecode@users.noreply.github.com>
  • Loading branch information
sciecode committed Dec 28, 2023
1 parent cd614f6 commit 2f73105
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions examples/jsm/controls/OrbitControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -1045,26 +1045,30 @@ class OrbitControls extends EventDispatcher {

removePointer( event );

if ( pointers.length === 0 ) {
switch ( pointers.length ) {

scope.domElement.releasePointerCapture( event.pointerId );
case 0:

scope.domElement.removeEventListener( 'pointermove', onPointerMove );
scope.domElement.removeEventListener( 'pointerup', onPointerUp );
scope.domElement.releasePointerCapture( event.pointerId );

}
scope.domElement.removeEventListener( 'pointermove', onPointerMove );
scope.domElement.removeEventListener( 'pointerup', onPointerUp );

scope.dispatchEvent( _endEvent );
scope.dispatchEvent( _endEvent );

state = STATE.NONE;
state = STATE.NONE;

if ( pointers.length == 1 ) {
break;

case 1:

const pointerId = pointers[ 0 ];
const position = pointerPositions[ pointerId ];

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 } );

// minimal placeholder event - allows state correction on pointer-up
onTouchStart( { pointerId: pointerId, pageX: position.x, pageY: position.y } );
break;

}

Expand Down

0 comments on commit 2f73105

Please sign in to comment.