Skip to content

Commit

Permalink
Fix touch action init
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Dec 29, 2023
1 parent 0ebf0c5 commit 2c23a69
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions example/src/GlobeControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,16 +286,23 @@ export class GlobeControls {
_pointerDist = _pointerTracker.getPointerDistance();
if ( _pinchAction === NONE ) {

if ( _pointerDist - _originalPointerDist > ACTION_THRESHOLD ) {
// check which direction was moved in first
const separateDistance = _pointerDist - _originalPointerDist;
const rotateDistance = _centerPoint.distanceTo( _originalCenterPoint );
if ( separateDistance > 0 && rotateDistance > 0 ) {

resetState();
_pinchAction = ZOOM;
this.zoomDirectionSet = false;
if ( separateDistance > rotateDistance ) {

} else if ( _centerPoint.distanceTo( _originalCenterPoint ) > ACTION_THRESHOLD ) {
resetState();
_pinchAction = ZOOM;
this.zoomDirectionSet = false;

_pinchAction = ROTATE;
} else {

_pinchAction = ROTATE;


}

}

Expand Down

0 comments on commit 2c23a69

Please sign in to comment.