mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 22:56:11 +03:00
No longer firing canvas-drag-end if there is no canvas-drag preceding
This commit is contained in:
parent
f15d5a2bff
commit
c4904fb460
@ -271,7 +271,10 @@
|
|||||||
lastPinchDist: 0,
|
lastPinchDist: 0,
|
||||||
currentPinchDist: 0,
|
currentPinchDist: 0,
|
||||||
lastPinchCenter: null,
|
lastPinchCenter: null,
|
||||||
currentPinchCenter: null
|
currentPinchCenter: null,
|
||||||
|
|
||||||
|
// Tracking for drag
|
||||||
|
sentDragEvent: false
|
||||||
};
|
};
|
||||||
|
|
||||||
this.hasGestureHandlers = !!( this.pressHandler || this.nonPrimaryPressHandler ||
|
this.hasGestureHandlers = !!( this.pressHandler || this.nonPrimaryPressHandler ||
|
||||||
@ -1446,6 +1449,8 @@
|
|||||||
for ( i = 0; i < pointerListCount; i++ ) {
|
for ( i = 0; i < pointerListCount; i++ ) {
|
||||||
delegate.activePointersLists.pop();
|
delegate.activePointersLists.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delegate.sentDragEvent = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3476,7 +3481,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Drag End
|
// Drag End
|
||||||
if ( tracker.dragEndHandler ) {
|
if ( tracker.dragEndHandler && delegate.sentDragEvent ) {
|
||||||
tracker.dragEndHandler(
|
tracker.dragEndHandler(
|
||||||
{
|
{
|
||||||
eventSource: tracker,
|
eventSource: tracker,
|
||||||
@ -3492,6 +3497,9 @@
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We want to clear this flag regardless of whether we fired the dragEndHandler
|
||||||
|
delegate.sentDragEvent = false;
|
||||||
|
|
||||||
// Click / Double-Click
|
// Click / Double-Click
|
||||||
if ( ( tracker.clickHandler || tracker.dblClickHandler ) && updateGPoint.insideElement ) {
|
if ( ( tracker.clickHandler || tracker.dblClickHandler ) && updateGPoint.insideElement ) {
|
||||||
quick = releaseTime - updateGPoint.contactTime <= tracker.clickTimeThreshold &&
|
quick = releaseTime - updateGPoint.contactTime <= tracker.clickTimeThreshold &&
|
||||||
@ -3679,6 +3687,7 @@
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
eventInfo.preventDefault = true;
|
eventInfo.preventDefault = true;
|
||||||
|
delegate.sentDragEvent = true;
|
||||||
}
|
}
|
||||||
} else if ( pointsList.contacts === 2 ) {
|
} else if ( pointsList.contacts === 2 ) {
|
||||||
// Move (2 contacts, use center)
|
// Move (2 contacts, use center)
|
||||||
|
Loading…
Reference in New Issue
Block a user