diff --git a/src/navigator.js b/src/navigator.js index 115d052d..64b8c3a8 100644 --- a/src/navigator.js +++ b/src/navigator.js @@ -455,7 +455,7 @@ function onCanvasClick( event ) { this.viewer.raiseEvent('navigator-click', canvasClickEventArgs); if ( !canvasClickEventArgs.preventDefaultAction && event.quick && this.viewer.viewport && (this.panVertical || this.panHorizontal)) { - if(this.viewer.viewport.flipped) { + if((this.viewer.viewport.flipped && !this.world._items[0].flipped) || (!this.viewer.viewport.flipped && this.world._items[0].flipped)) { event.position.x = this.viewport.getContainerSize().x - event.position.x; } var target = this.viewport.pointFromPixel(event.position); @@ -515,7 +515,7 @@ function onCanvasDrag( event ) { event.delta.y = 0; } - if(this.viewer.viewport.flipped){ + if((this.viewer.viewport.flipped && !this.world._items[0].flipped) || (!this.viewer.viewport.flipped && this.world._items[0].flipped)) { event.delta.x = -event.delta.x; } diff --git a/src/viewer.js b/src/viewer.js index d023e985..5ea11eb4 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -2642,7 +2642,7 @@ function onCanvasKeyPress( event ) { } return false; case 114: //r - clockwise rotation - if(this.viewport.flipped){ + if((this.viewport.flipped && !this.world._items[0].flipped) || (!this.viewport.flipped && this.world._items[0].flipped)){ this.viewport.setRotation($.positiveModulo(this.viewport.degrees - this.rotationIncrement, 360)); } else{ this.viewport.setRotation($.positiveModulo(this.viewport.degrees + this.rotationIncrement, 360)); @@ -2650,7 +2650,7 @@ function onCanvasKeyPress( event ) { this.viewport.applyConstraints(); return false; case 82: //R - counterclockwise rotation - if(this.viewport.flipped){ + if((this.viewport.flipped && !this.world._items[0].flipped) || (!this.viewport.flipped && this.world._items[0].flipped)){ this.viewport.setRotation($.positiveModulo(this.viewport.degrees + this.rotationIncrement, 360)); } else{ this.viewport.setRotation($.positiveModulo(this.viewport.degrees - this.rotationIncrement, 360)); @@ -2678,7 +2678,7 @@ function onCanvasClick( event ) { if ( !haveKeyboardFocus ) { this.canvas.focus(); } - if(this.viewport.flipped){ + if((this.viewport.flipped && !this.world._items[0].flipped) || (!this.viewport.flipped && this.world._items[0].flipped)){ event.position.x = this.viewport.getContainerSize().x - event.position.x; } @@ -2800,7 +2800,7 @@ function onCanvasDrag( event ) { if( !this.panVertical ){ event.delta.y = 0; } - if(this.viewport.flipped){ + if((this.viewport.flipped && !this.world._items[0].flipped) || (!this.viewport.flipped && this.world._items[0].flipped)){ event.delta.x = -event.delta.x; } @@ -3128,7 +3128,7 @@ function onCanvasScroll( event ) { if (deltaScrollTime > this.minScrollDeltaTime) { this._lastScrollTime = thisScrollTime; - if(this.viewport.flipped){ + if((this.viewport.flipped && !this.world._items[0].flipped) || (!this.viewport.flipped && this.world._items[0].flipped)){ event.position.x = this.viewport.getContainerSize().x - event.position.x; } @@ -3495,7 +3495,7 @@ function onRotateLeft() { if ( this.viewport ) { var currRotation = this.viewport.getRotation(); - if ( this.viewport.flipped ){ + if((this.viewport.flipped && !this.world._items[0].flipped) || (!this.viewport.flipped && this.world._items[0].flipped)){ currRotation = $.positiveModulo(currRotation + this.rotationIncrement, 360); } else { currRotation = $.positiveModulo(currRotation - this.rotationIncrement, 360); @@ -3508,7 +3508,7 @@ function onRotateRight() { if ( this.viewport ) { var currRotation = this.viewport.getRotation(); - if ( this.viewport.flipped ){ + if((this.viewport.flipped && !this.world._items[0].flipped) || (!this.viewport.flipped && this.world._items[0].flipped)){ currRotation = $.positiveModulo(currRotation - this.rotationIncrement, 360); } else { currRotation = $.positiveModulo(currRotation + this.rotationIncrement, 360);