mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 05:06:09 +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;
|
||||
case 114: //r - clockwise rotation
|
||||
if(this.viewport.flipped){
|
||||
this.viewport.setRotation($.positiveModulo(this.viewport.getRotation() - this.rotationIncrement, 360));
|
||||
this.viewport.setRotation(this.viewport.getRotation() - this.rotationIncrement);
|
||||
} else{
|
||||
this.viewport.setRotation($.positiveModulo(this.viewport.getRotation() + this.rotationIncrement, 360));
|
||||
this.viewport.setRotation(this.viewport.getRotation() + this.rotationIncrement);
|
||||
}
|
||||
this.viewport.applyConstraints();
|
||||
event.preventDefault = true;
|
||||
break;
|
||||
case 82: //R - counterclockwise rotation
|
||||
if(this.viewport.flipped){
|
||||
this.viewport.setRotation($.positiveModulo(this.viewport.getRotation() + this.rotationIncrement, 360));
|
||||
this.viewport.setRotation(this.viewport.getRotation() + this.rotationIncrement);
|
||||
} else{
|
||||
this.viewport.setRotation($.positiveModulo(this.viewport.getRotation() - this.rotationIncrement, 360));
|
||||
this.viewport.setRotation(this.viewport.getRotation() - this.rotationIncrement);
|
||||
}
|
||||
this.viewport.applyConstraints();
|
||||
event.preventDefault = true;
|
||||
@ -3708,9 +3708,9 @@ function onRotateLeft() {
|
||||
var currRotation = this.viewport.getRotation();
|
||||
|
||||
if ( this.viewport.flipped ){
|
||||
currRotation = $.positiveModulo(currRotation + this.rotationIncrement, 360);
|
||||
currRotation += this.rotationIncrement;
|
||||
} else {
|
||||
currRotation = $.positiveModulo(currRotation - this.rotationIncrement, 360);
|
||||
currRotation -= this.rotationIncrement;
|
||||
}
|
||||
this.viewport.setRotation(currRotation);
|
||||
}
|
||||
@ -3721,9 +3721,9 @@ function onRotateRight() {
|
||||
var currRotation = this.viewport.getRotation();
|
||||
|
||||
if ( this.viewport.flipped ){
|
||||
currRotation = $.positiveModulo(currRotation - this.rotationIncrement, 360);
|
||||
currRotation -= this.rotationIncrement;
|
||||
} else {
|
||||
currRotation = $.positiveModulo(currRotation + this.rotationIncrement, 360);
|
||||
currRotation += this.rotationIncrement;
|
||||
}
|
||||
this.viewport.setRotation(currRotation);
|
||||
}
|
||||
|
@ -138,6 +138,7 @@ $.Viewport = function( options ) {
|
||||
springStiffness: this.springStiffness,
|
||||
animationTime: this.animationTime
|
||||
});
|
||||
delete options.degrees;
|
||||
|
||||
this._oldCenterX = this.centerSpringX.current.value;
|
||||
this._oldCenterY = this.centerSpringY.current.value;
|
||||
@ -904,8 +905,6 @@ $.Viewport.prototype = {
|
||||
this.degreesSpring.springTo(degrees);
|
||||
}
|
||||
|
||||
this.degrees = $.positiveModulo(this.degreesSpring.target.value, 360);
|
||||
|
||||
this._setContentBounds(
|
||||
this.viewer.world.getHomeBounds(),
|
||||
this.viewer.world.getContentFactor());
|
||||
|
Loading…
Reference in New Issue
Block a user