mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
Refactored 90 degrees rotation button's actions.
This commit is contained in:
parent
ec0f55098a
commit
43d3949dd1
@ -526,10 +526,4 @@ function setElementTransform( element, rule ) {
|
|||||||
element.style.transform = rule;
|
element.style.transform = rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}( OpenSeadragon ));
|
}( OpenSeadragon ));
|
||||||
|
@ -3476,20 +3476,11 @@ function onFullScreen() {
|
|||||||
function onRotateLeft() {
|
function onRotateLeft() {
|
||||||
if ( this.viewport ) {
|
if ( this.viewport ) {
|
||||||
var currRotation = this.viewport.getRotation();
|
var currRotation = this.viewport.getRotation();
|
||||||
|
|
||||||
if ( this.viewport.flipped ){
|
if ( this.viewport.flipped ){
|
||||||
if (currRotation === 270) {
|
currRotation = $.positiveModulo(currRotation + 90, 360);
|
||||||
currRotation = 0;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
currRotation += 90;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (currRotation === 0) {
|
currRotation = $.positiveModulo(currRotation - 90, 360);
|
||||||
currRotation = 270;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
currRotation -= 90;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.viewport.setRotation(currRotation);
|
this.viewport.setRotation(currRotation);
|
||||||
}
|
}
|
||||||
@ -3501,20 +3492,11 @@ function onRotateLeft() {
|
|||||||
function onRotateRight() {
|
function onRotateRight() {
|
||||||
if ( this.viewport ) {
|
if ( this.viewport ) {
|
||||||
var currRotation = this.viewport.getRotation();
|
var currRotation = this.viewport.getRotation();
|
||||||
|
|
||||||
if ( this.viewport.flipped ){
|
if ( this.viewport.flipped ){
|
||||||
if (currRotation === 0) {
|
currRotation = $.positiveModulo(currRotation - 90, 360);
|
||||||
currRotation = 270;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
currRotation -= 90;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (currRotation === 270) {
|
currRotation = $.positiveModulo(currRotation + 90, 360);
|
||||||
currRotation = 0;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
currRotation += 90;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.viewport.setRotation(currRotation);
|
this.viewport.setRotation(currRotation);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user