diff --git a/src/viewer.js b/src/viewer.js index a138e2de..985ba468 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -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); } diff --git a/src/viewport.js b/src/viewport.js index 118f8184..d37bfbae 100644 --- a/src/viewport.js +++ b/src/viewport.js @@ -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());