Fix flipped debug drawing context

This commit is contained in:
Nelson Campos 2018-10-18 15:29:08 +01:00
parent 2670f62892
commit 4fe5a84170

View File

@ -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();
},