mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-01-19 09:11:45 +03:00
Merge pull request #2158 from cavenel/master
Fix wrong center point on pinch zoom
This commit is contained in:
commit
f3f20fd30d
@ -3289,9 +3289,6 @@ function onCanvasPinch( event ) {
|
||||
if ( gestureSettings.pinchToZoom &&
|
||||
(!canvasPinchEventArgs.preventDefaultPanAction || !canvasPinchEventArgs.preventDefaultZoomAction) ) {
|
||||
centerPt = this.viewport.pointFromPixel( event.center, true );
|
||||
if ( !canvasPinchEventArgs.preventDefaultZoomAction ) {
|
||||
this.viewport.zoomBy( event.distance / event.lastDistance, centerPt, true );
|
||||
}
|
||||
if ( gestureSettings.zoomToRefPoint && !canvasPinchEventArgs.preventDefaultPanAction ) {
|
||||
lastCenterPt = this.viewport.pointFromPixel( event.lastCenter, true );
|
||||
panByPt = lastCenterPt.minus( centerPt );
|
||||
@ -3303,6 +3300,9 @@ function onCanvasPinch( event ) {
|
||||
}
|
||||
this.viewport.panBy(panByPt, true);
|
||||
}
|
||||
if ( !canvasPinchEventArgs.preventDefaultZoomAction ) {
|
||||
this.viewport.zoomBy( event.distance / event.lastDistance, centerPt, true );
|
||||
}
|
||||
this.viewport.applyConstraints();
|
||||
}
|
||||
if ( gestureSettings.pinchRotate && !canvasPinchEventArgs.preventDefaultRotateAction ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user