From 15a0db045e0b6a991c49c20cf87a467424e17b17 Mon Sep 17 00:00:00 2001 From: Antoine Vandecreme Date: Thu, 31 Mar 2016 15:45:44 -0400 Subject: [PATCH] Fix changelog and add comments. --- changelog.txt | 4 +++- src/overlay.js | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 744d09b2..962118f8 100644 --- a/changelog.txt +++ b/changelog.txt @@ -5,6 +5,7 @@ OPENSEADRAGON CHANGELOG * BREAKING CHANGE: Viewport.homeBounds, Viewport.contentSize, Viewport.contentAspectX and Viewport.contentAspectY have been removed. (#846) +* BREAKING CHANGE: Overlay.scales, Overlay.bounds and Overlay.position have been removed. (#896) * DEPRECATION: Viewport.setHomeBounds has been deprecated (#846) * DEPRECATION: the Viewport constructor is now ignoring the contentSize option (#846) * Tile edge smoothing at high zoom (#764) @@ -30,7 +31,8 @@ OPENSEADRAGON CHANGELOG * Fixed issue causing HTML pages to jump unwantedly to the reference strip upon loading (#872) * Added addOnceHandler method to EventSource (#887) * Added TiledImage.fitBounds method (#888) -* Added scaledWidth and scaleHeight options to Rect overlays to allow to scale in only one dimension. +* Overlays can now be scaled in only one dimension by providing a point location and either width or height (#896) +* Added full rotation support to overlays (#729, #193) 2.1.0: diff --git a/src/overlay.js b/src/overlay.js index c59219f4..0f276dd5 100644 --- a/src/overlay.js +++ b/src/overlay.js @@ -140,10 +140,16 @@ this.onDraw = options.onDraw; this.checkResize = options.checkResize === undefined ? true : options.checkResize; + + // When this.width is not null, the overlay get scaled horizontally this.width = options.width === undefined ? null : options.width; + + // When this.height is not null, the overlay get scaled vertically this.height = options.height === undefined ? null : options.height; + this.rotationMode = options.rotationMode || $.OverlayRotationMode.EXACT; + // Having a rect as location is a syntactic sugar if (this.location instanceof $.Rect) { this.width = this.location.width; this.height = this.location.height; @@ -231,6 +237,9 @@ element.prevElementParent = element.parentNode; element.prevNextSibling = element.nextSibling; container.appendChild(element); + + // this.size is used by overlays which don't get scaled in at + // least one direction when this.checkResize is set to false. this.size = $.getElementSize(element); }