From ab6cdf102e0154701d4b04ec2597076baa175b5b Mon Sep 17 00:00:00 2001 From: jonw-cogapp Date: Fri, 21 Apr 2017 18:19:11 +0100 Subject: [PATCH] prevent unnecessary panBy on canvas-drag in viewer --- src/viewer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/viewer.js b/src/viewer.js index 7e9f36c3..7a75d6a5 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -2573,7 +2573,9 @@ function onCanvasDrag( event ) { if( !this.panVertical ){ event.delta.y = 0; } - this.viewport.panBy( this.viewport.deltaPointsFromPixels( event.delta.negate() ), gestureSettings.flickEnabled ); + if( event.delta.x !== 0 || event.delta.y !== 0){ + this.viewport.panBy( this.viewport.deltaPointsFromPixels( event.delta.negate() ), gestureSettings.flickEnabled ); + } if( this.constrainDuringPan ){ this.viewport.applyConstraints(); }