diff --git a/src/drawer.js b/src/drawer.js index a099a5b7..e99b56fe 100644 --- a/src/drawer.js +++ b/src/drawer.js @@ -509,7 +509,7 @@ $.Drawer.prototype = { }); } if((this.viewport.degrees == 0 && tiledImage.getRotation(true) % 360 !== 0) || (this.viewport.degrees !== 0 && tiledImage.getRotation(true) % 360 == 0)){ - if((this.viewport.getFlip() && !tiledImage.flipped) || (!this.viewport.getFlip() && tiledImage.flipped) ) { + if((this.viewport.getFlip() && !tiledImage.getFlip()) || (!this.viewport.getFlip() && tiledImage.getFlip()) ) { this._flip(); } } @@ -648,7 +648,7 @@ $.Drawer.prototype = { context.translate(point.x, point.y); // If viewport and tiledImage are flipped, it would draw the image without flipping // This if sentence is intended to represent a logical XOR - if((!this.viewer.viewport.getFlip() && this.viewer.world._items[0].flipped) || (this.viewer.viewport.getFlip() && !this.viewer.world._items[0].flipped)){ + if((!this.viewer.viewport.getFlip() && this.viewer.world._items[0].getFlip()) || (this.viewer.viewport.getFlip() && !this.viewer.world._items[0].getFlip())){ context.rotate(Math.PI / 180 * -options.degrees); context.scale(-1, 1); } else{ diff --git a/src/navigator.js b/src/navigator.js index 41d6e8d0..bb4e08d6 100644 --- a/src/navigator.js +++ b/src/navigator.js @@ -351,8 +351,6 @@ $.extend( $.Navigator.prototype, $.EventSource.prototype, $.Viewer.prototype, /* style.height = Math.round( Math.max( height, 0 ) ) + 'px'; } - - }, // overrides Viewer.addTiledImage @@ -456,6 +454,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.getFlip() && !this.world._items[0].getFlip()) || (!this.viewer.viewport.getFlip() && this.world._items[0].getFlip())) { event.position.x = this.viewport.getContainerSize().x - event.position.x; diff --git a/src/openseadragon.js b/src/openseadragon.js index 30cf6ed3..e3d9aed7 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -271,7 +271,7 @@ * events between different devices, causing the faster devices to slow down enough to make the zoom control * more manageable. * - * @property {Number} [rotationIncrement=10] + * @property {Number} [rotationIncrement=90] * The number of degrees to rotate right or left when the rotate buttons or keyboard shortcuts are activated. * * @property {Number} [pixelsPerWheelLine=40] diff --git a/src/tiledimage.js b/src/tiledimage.js index 0da96e7d..6501751a 100644 --- a/src/tiledimage.js +++ b/src/tiledimage.js @@ -1902,6 +1902,7 @@ function drawTiles( tiledImage, lastDrawn ) { } tiledImage._drawer._clear(true, bounds); } + // When scaling, we must rotate only when blending the sketch canvas to // avoid interpolation if (!sketchScale) { @@ -2044,7 +2045,6 @@ function drawTiles( tiledImage, lastDrawn ) { } } - drawDebugInfo( tiledImage, lastDrawn ); } diff --git a/src/viewer.js b/src/viewer.js index e1d50bc5..f622829c 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -2679,7 +2679,6 @@ function onCanvasClick( event ) { this.canvas.focus(); } if((this.viewport.getFlip() && !this.world._items[0].getFlip()) || (!this.viewport.getFlip() && this.world._items[0].getFlip())){ - console.log("FLipped Click"); event.position.x = this.viewport.getContainerSize().x - event.position.x; } @@ -3367,6 +3366,10 @@ function updateOnce( viewer ) { THIS[ viewer.hash ].animating = animated; + // Update navigator flip transformation + if (viewer.navigator && viewer.viewport != "undefined"){ + viewer.navigator.setFlip(viewer.viewport.getFlip()); + } //viewer.profiler.endUpdate(); } diff --git a/src/viewport.js b/src/viewport.js index 07c941c6..61cee041 100644 --- a/src/viewport.js +++ b/src/viewport.js @@ -1552,7 +1552,8 @@ $.Viewport.prototype = { this.flipped = state; if(this.viewer.navigator){ - this.viewer.navigator.setFlip(this.getFlip()); + var flip = ((this.getFlip() || !this.viewer.world._items[0].getFlip()) || (!this.getFlip() || this.viewer.world._items[0].getFlip())); + this.viewer.navigator.setFlip(flip); } this.viewer.forceRedraw();