mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 14:46:10 +03:00
removed modulo for degrees to avoid spining
This commit is contained in:
parent
8746e8b243
commit
dc2a1534d3
@ -2810,18 +2810,18 @@ function onCanvasKeyPress( event ) {
|
|||||||
break;
|
break;
|
||||||
case 114: //r - clockwise rotation
|
case 114: //r - clockwise rotation
|
||||||
if(this.viewport.flipped){
|
if(this.viewport.flipped){
|
||||||
this.viewport.setRotation($.positiveModulo(this.viewport.getRotation() - this.rotationIncrement, 360));
|
this.viewport.setRotation(this.viewport.getRotation() - this.rotationIncrement);
|
||||||
} else{
|
} else{
|
||||||
this.viewport.setRotation($.positiveModulo(this.viewport.getRotation() + this.rotationIncrement, 360));
|
this.viewport.setRotation(this.viewport.getRotation() + this.rotationIncrement);
|
||||||
}
|
}
|
||||||
this.viewport.applyConstraints();
|
this.viewport.applyConstraints();
|
||||||
event.preventDefault = true;
|
event.preventDefault = true;
|
||||||
break;
|
break;
|
||||||
case 82: //R - counterclockwise rotation
|
case 82: //R - counterclockwise rotation
|
||||||
if(this.viewport.flipped){
|
if(this.viewport.flipped){
|
||||||
this.viewport.setRotation($.positiveModulo(this.viewport.getRotation() + this.rotationIncrement, 360));
|
this.viewport.setRotation(this.viewport.getRotation() + this.rotationIncrement);
|
||||||
} else{
|
} else{
|
||||||
this.viewport.setRotation($.positiveModulo(this.viewport.getRotation() - this.rotationIncrement, 360));
|
this.viewport.setRotation(this.viewport.getRotation() - this.rotationIncrement);
|
||||||
}
|
}
|
||||||
this.viewport.applyConstraints();
|
this.viewport.applyConstraints();
|
||||||
event.preventDefault = true;
|
event.preventDefault = true;
|
||||||
@ -3708,9 +3708,9 @@ function onRotateLeft() {
|
|||||||
var currRotation = this.viewport.getRotation();
|
var currRotation = this.viewport.getRotation();
|
||||||
|
|
||||||
if ( this.viewport.flipped ){
|
if ( this.viewport.flipped ){
|
||||||
currRotation = $.positiveModulo(currRotation + this.rotationIncrement, 360);
|
currRotation += this.rotationIncrement;
|
||||||
} else {
|
} else {
|
||||||
currRotation = $.positiveModulo(currRotation - this.rotationIncrement, 360);
|
currRotation -= this.rotationIncrement;
|
||||||
}
|
}
|
||||||
this.viewport.setRotation(currRotation);
|
this.viewport.setRotation(currRotation);
|
||||||
}
|
}
|
||||||
@ -3721,9 +3721,9 @@ function onRotateRight() {
|
|||||||
var currRotation = this.viewport.getRotation();
|
var currRotation = this.viewport.getRotation();
|
||||||
|
|
||||||
if ( this.viewport.flipped ){
|
if ( this.viewport.flipped ){
|
||||||
currRotation = $.positiveModulo(currRotation - this.rotationIncrement, 360);
|
currRotation -= this.rotationIncrement;
|
||||||
} else {
|
} else {
|
||||||
currRotation = $.positiveModulo(currRotation + this.rotationIncrement, 360);
|
currRotation += this.rotationIncrement;
|
||||||
}
|
}
|
||||||
this.viewport.setRotation(currRotation);
|
this.viewport.setRotation(currRotation);
|
||||||
}
|
}
|
||||||
|
@ -138,6 +138,7 @@ $.Viewport = function( options ) {
|
|||||||
springStiffness: this.springStiffness,
|
springStiffness: this.springStiffness,
|
||||||
animationTime: this.animationTime
|
animationTime: this.animationTime
|
||||||
});
|
});
|
||||||
|
delete options.degrees;
|
||||||
|
|
||||||
this._oldCenterX = this.centerSpringX.current.value;
|
this._oldCenterX = this.centerSpringX.current.value;
|
||||||
this._oldCenterY = this.centerSpringY.current.value;
|
this._oldCenterY = this.centerSpringY.current.value;
|
||||||
@ -904,8 +905,6 @@ $.Viewport.prototype = {
|
|||||||
this.degreesSpring.springTo(degrees);
|
this.degreesSpring.springTo(degrees);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.degrees = $.positiveModulo(this.degreesSpring.target.value, 360);
|
|
||||||
|
|
||||||
this._setContentBounds(
|
this._setContentBounds(
|
||||||
this.viewer.world.getHomeBounds(),
|
this.viewer.world.getHomeBounds(),
|
||||||
this.viewer.world.getContentFactor());
|
this.viewer.world.getContentFactor());
|
||||||
|
Loading…
Reference in New Issue
Block a user