Skip to content

Commit

Permalink
Ensure a finish event fires when fingers have just been placed and re…
Browse files Browse the repository at this point in the history
…moved
  • Loading branch information
gkjohnson committed Jan 17, 2024
1 parent 3a45ab0 commit 03b947d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion example/src/controls/TileControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const NONE = 0;
export const DRAG = 1;
export const ROTATE = 2;
export const ZOOM = 3;
export const WAITING = 4;

const DRAG_PLANE_THRESHOLD = 0.05;
const DRAG_UP_THRESHOLD = 0.025;
Expand Down Expand Up @@ -244,6 +245,7 @@ export class TileControls {
if ( this.state === DRAG ) {

this._updatePosition();
// this.setState( NONE, WAITING, false );

}

Expand All @@ -264,7 +266,8 @@ export class TileControls {
const previousDist = pointerTracker.getPreviousPointerDistance();
const pointerDist = pointerTracker.getPointerDistance();
const separateDelta = pointerDist - previousDist;
if ( pinchAction === NONE ) {

if ( this.pinchState === NONE || this.pinchState === WAITING ) {

// check which direction was moved in first - if the pointers are pinching then
// it's a zoom. But if they move in parallel it's a rotation
Expand Down

0 comments on commit 03b947d

Please sign in to comment.