diff --git a/src/viewer.js b/src/viewer.js index ab779142..d33a4a26 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -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 ) {