Call Viewport.applyConstraints() on drag-end when flick gesture is enabled

This commit is contained in:
Mark Salsbery 2014-08-06 11:26:18 -07:00
parent ee3ab70025
commit 1d5b059fcc

View File

@ -2388,8 +2388,8 @@ function onCanvasDragEnd( event ) {
target.y = center.y; target.y = center.y;
} }
this.viewport.panTo( target, false ); this.viewport.panTo( target, false );
this.viewport.applyConstraints();
} }
this.viewport.applyConstraints();
} }
/** /**
* Raised when a mouse or touch drag operation ends on the {@link OpenSeadragon.Viewer#canvas} element. * Raised when a mouse or touch drag operation ends on the {@link OpenSeadragon.Viewer#canvas} element.
@ -2417,15 +2417,6 @@ function onCanvasDragEnd( event ) {
} }
function onCanvasRelease( event ) { function onCanvasRelease( event ) {
var gestureSettings;
if ( event.insideElementPressed && this.viewport ) {
gestureSettings = this.gestureSettingsByDeviceType( event.pointerType );
if ( !gestureSettings.flickEnabled ) {
this.viewport.applyConstraints();
}
}
/** /**
* Raised when the mouse button is released or touch ends on the {@link OpenSeadragon.Viewer#canvas} element. * Raised when the mouse button is released or touch ends on the {@link OpenSeadragon.Viewer#canvas} element.
* *