Add old properties for backward compatibility.

This commit is contained in:
Antoine Vandecreme 2016-04-05 13:05:32 -04:00
parent 96a032164f
commit 53d1534cc2
2 changed files with 11 additions and 3 deletions

View File

@ -5,9 +5,11 @@ OPENSEADRAGON CHANGELOG
* BREAKING CHANGE: Viewport.homeBounds, Viewport.contentSize, Viewport.contentAspectX and * BREAKING CHANGE: Viewport.homeBounds, Viewport.contentSize, Viewport.contentAspectX and
Viewport.contentAspectY have been removed. (#846) Viewport.contentAspectY have been removed. (#846)
* BREAKING CHANGE: Overlay.scales, Overlay.bounds and Overlay.position have been removed. (#896) * BREAKING CHANGE: The Overlay.getBounds method now takes the viewport as parameter. (#896)
* Overlay.scales can be replaced by Overlay.width !== null && Overlay.height !== null * DEPRECATION: Overlay.scales, Overlay.bounds and Overlay.position have been deprecated. (#896)
* The Overlay.getBounds method can be used to get the bounds of the overlay in viewport coordinates * Overlay.width !== null should be used to test whether the overlay scales horizontally
* Overlay.height !== null should be used to test whether the overlay scales vertically
* The Overlay.getBounds method should be used to get the bounds of the overlay in viewport coordinates
* Overlay.location replaces Overlay.position * Overlay.location replaces Overlay.position
* DEPRECATION: Viewport.setHomeBounds has been deprecated (#846) * DEPRECATION: Viewport.setHomeBounds has been deprecated (#846)
* DEPRECATION: the Viewport constructor is now ignoring the contentSize option (#846) * DEPRECATION: the Viewport constructor is now ignoring the contentSize option (#846)

View File

@ -156,6 +156,12 @@
this.location = this.location.getTopLeft(); this.location = this.location.getTopLeft();
this.placement = $.Placement.TOP_LEFT; this.placement = $.Placement.TOP_LEFT;
} }
// Deprecated properties kept for backward compatibility.
this.scales = this.width !== null && this.height !== null;
this.bounds = new $.Rect(
this.location.x, this.location.y, this.width, this.height);
this.position = this.location;
}, },
/** /**