diff --git a/src/drawer.js b/src/drawer.js index e99b56fe..cf86b61b 100644 --- a/src/drawer.js +++ b/src/drawer.js @@ -508,9 +508,9 @@ $.Drawer.prototype = { tiledImage._getRotationPoint(true), true) }); } - if((this.viewport.degrees == 0 && tiledImage.getRotation(true) % 360 !== 0) || (this.viewport.degrees !== 0 && tiledImage.getRotation(true) % 360 == 0)){ - if((this.viewport.getFlip() && !tiledImage.getFlip()) || (!this.viewport.getFlip() && tiledImage.getFlip()) ) { - this._flip(); + if (tiledImage.viewport.degrees == 0 && tiledImage.getRotation(true) % 360 == 0){ + if((tiledImage._drawer.viewer.viewport.getFlip() && !tiledImage.getFlip()) || (!tiledImage._drawer.viewer.viewport.getFlip() && tiledImage.getFlip()) ) { + tiledImage._drawer._flip({}); } } @@ -578,6 +578,13 @@ $.Drawer.prototype = { if (tiledImage.getRotation(true) % 360 !== 0) { this._restoreRotationChanges(); } + + if (tiledImage.viewport.degrees == 0 && tiledImage.getRotation(true) % 360 == 0){ + if((tiledImage._drawer.viewer.viewport.getFlip() && !tiledImage.getFlip()) || (!tiledImage._drawer.viewer.viewport.getFlip() && tiledImage.getFlip()) ) { + tiledImage._drawer._flip({}); + } + } + context.restore(); },