diff --git a/src/navigator.js b/src/navigator.js index e06ba658..89562bcb 100644 --- a/src/navigator.js +++ b/src/navigator.js @@ -526,10 +526,4 @@ function setElementTransform( element, rule ) { element.style.transform = rule; } - - - - - - }( OpenSeadragon )); diff --git a/src/viewer.js b/src/viewer.js index 8be90044..b24086e0 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -3476,20 +3476,11 @@ function onFullScreen() { function onRotateLeft() { if ( this.viewport ) { var currRotation = this.viewport.getRotation(); + if ( this.viewport.flipped ){ - if (currRotation === 270) { - currRotation = 0; - } - else { - currRotation += 90; - } + currRotation = $.positiveModulo(currRotation + 90, 360); } else { - if (currRotation === 0) { - currRotation = 270; - } - else { - currRotation -= 90; - } + currRotation = $.positiveModulo(currRotation - 90, 360); } this.viewport.setRotation(currRotation); } @@ -3501,20 +3492,11 @@ function onRotateLeft() { function onRotateRight() { if ( this.viewport ) { var currRotation = this.viewport.getRotation(); + if ( this.viewport.flipped ){ - if (currRotation === 0) { - currRotation = 270; - } - else { - currRotation -= 90; - } + currRotation = $.positiveModulo(currRotation - 90, 360); } else { - if (currRotation === 270) { - currRotation = 0; - } - else { - currRotation += 90; - } + currRotation = $.positiveModulo(currRotation + 90, 360); } this.viewport.setRotation(currRotation); }