Skip to content

Commit

Permalink
EditorControls: Add duplicate pointer ID fix. (#27749)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 authored Feb 14, 2024
1 parent 8efe8f8 commit 3606ee1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions editor/js/EditorControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ class EditorControls extends THREE.EventDispatcher {

//

if ( isTrackingPointer( event ) ) return;

//

addPointer( event );

if ( event.pointerType === 'touch' ) {
Expand Down Expand Up @@ -392,6 +396,18 @@ class EditorControls extends THREE.EventDispatcher {

}

function isTrackingPointer( event ) {

for ( var i = 0; i < pointers.length; i ++ ) {

if ( pointers[ i ] == event.pointerId ) return true;

}

return false;

}

function trackPointer( event ) {

var position = pointerPositions[ event.pointerId ];
Expand Down

0 comments on commit 3606ee1

Please sign in to comment.