Rename method, update logic

This commit is contained in:
superbland 2021-10-30 15:01:17 +01:00 committed by superbland
parent 45bdd87224
commit 92bcfa5416

View File

@ -420,10 +420,12 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
},
/**
* @returns {OpenSeadragon.Point} The dimensions of the image as it would be currently rendered in the viewport
* @returns {OpenSeadragon.Point} The TiledImage's content size, in window coordinates.
*/
getRelativeSize: function() {
return this.getContentSize().times(this.viewport.getZoom());
getSizeInWindowCoordinates: function() {
var topLeft = this.viewport.imageToWindowCoordinates(new $.Point(0, 0));
var bottomRight = this.viewport.imageToWindowCoordinates(this.getContentSize());
return new $.Point(bottomRight.x - topLeft.x, bottomRight.y - topLeft.y);
},
// private