From 4fe5a841704162db2cd2a72a29a4f63368cce687 Mon Sep 17 00:00:00 2001 From: Nelson Campos Date: Thu, 18 Oct 2018 15:29:08 +0100 Subject: [PATCH] Fix flipped debug drawing context --- src/drawer.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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(); },