mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
Add utility method for getting relative size
This commit is contained in:
parent
d1a5e926c6
commit
11ef3fcfbb
@ -419,6 +419,13 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
|
|||||||
return new $.Point(this.source.dimensions.x, this.source.dimensions.y);
|
return new $.Point(this.source.dimensions.x, this.source.dimensions.y);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @returns {OpenSeadragon.Point} The dimensions of the image as it would be currently rendered in the viewport
|
||||||
|
*/
|
||||||
|
getRelativeSize: function() {
|
||||||
|
return this.getContentSize().times(this.viewport.getZoom());
|
||||||
|
},
|
||||||
|
|
||||||
// private
|
// private
|
||||||
_viewportToImageDelta: function( viewerX, viewerY, current ) {
|
_viewportToImageDelta: function( viewerX, viewerY, current ) {
|
||||||
var scale = (current ? this._scaleSpring.current.value : this._scaleSpring.target.value);
|
var scale = (current ? this._scaleSpring.current.value : this._scaleSpring.target.value);
|
||||||
|
Loading…
Reference in New Issue
Block a user