prevent unnecessary panBy on canvas-drag in viewer

This commit is contained in:
jonw-cogapp 2017-04-21 18:19:11 +01:00
parent be382a47b6
commit ab6cdf102e

View File

@ -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();
}