Only apply constraints during an actual drag

This commit is contained in:
superbland 2017-04-24 22:47:40 +01:00
parent ab6cdf102e
commit bb229c24d3

View File

@ -2573,11 +2573,11 @@ function onCanvasDrag( event ) {
if( !this.panVertical ){
event.delta.y = 0;
}
if( event.delta.x !== 0 || event.delta.y !== 0){
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();
if( this.constrainDuringPan ){
this.viewport.applyConstraints();
}
}
}
}