mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-21 20:56:09 +03:00
Add rotateBy and rotateTo to the API
This commit is contained in:
parent
51807a77f0
commit
bfddf7355b
@ -1007,6 +1007,34 @@ $.Viewport.prototype = {
|
|||||||
this.degreesSpring.target.value;
|
this.degreesSpring.target.value;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rotates this viewport to the angle specified. Alias for setRotation to be consistent with with pan and zoom API
|
||||||
|
* @function
|
||||||
|
* @param {Number} degrees The degrees to set the rotation to.
|
||||||
|
* @param {Boolean} [immediately=false] Whether to animate to the new angle
|
||||||
|
* or rotate immediately.
|
||||||
|
* @param {OpenSeadragon.Point} [pivot=false] (Optional) point in viewport coordinates
|
||||||
|
* around which the rotation should be performed. Defaults to the center of the viewport.
|
||||||
|
* @returns {OpenSeadragon.Viewport} Chainable.
|
||||||
|
*/
|
||||||
|
rotateTo: function(degrees, immediately, pivot){
|
||||||
|
return this.setRotation(degrees, immediately, pivot);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rotates this viewport by the angle specified. Alias for setRotation to be consistent with with pan and zoom API
|
||||||
|
* @function
|
||||||
|
* @param {Number} degrees The degrees by which to rotate the viewport.
|
||||||
|
* @param {Boolean} [immediately=false] Whether to animate to the new angle
|
||||||
|
* or rotate immediately.
|
||||||
|
* @param {OpenSeadragon.Point} [pivot=false] (Optional) point in viewport coordinates
|
||||||
|
* around which the rotation should be performed. Defaults to the center of the viewport.
|
||||||
|
* @returns {OpenSeadragon.Viewport} Chainable.
|
||||||
|
*/
|
||||||
|
rotateBy: function(degrees, immediately, pivot){
|
||||||
|
return this.setRotation(this.degreesSpring.target.value + degrees, immediately, pivot);
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function
|
* @function
|
||||||
* @returns {OpenSeadragon.Viewport} Chainable.
|
* @returns {OpenSeadragon.Viewport} Chainable.
|
||||||
|
Loading…
Reference in New Issue
Block a user