From 3232ba4fe5c22b3532078100025bffc4abb7a318 Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Wed, 14 Jan 2015 17:06:18 -0800 Subject: [PATCH] * Fixed an error in fitBounds if the new and old bounds were extremely close in size --- changelog.txt | 1 + src/viewport.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 1e7f78a5..e73a5cb7 100644 --- a/changelog.txt +++ b/changelog.txt @@ -42,6 +42,7 @@ OPENSEADRAGON CHANGELOG * Turning off scrollToZoom in gestureSettings now allows scroll events to propagate * You can now set a minZoomLevel that's greater than the home zoom level * Added union() to OpenSeadragon.Rect +* Fixed an error in fitBounds if the new and old bounds were extremely close in size 1.2.1: (in progress) diff --git a/src/viewport.js b/src/viewport.js index 0f7f5cf1..d6fc2984 100644 --- a/src/viewport.js +++ b/src/viewport.js @@ -586,7 +586,8 @@ $.Viewport.prototype = /** @lends OpenSeadragon.Viewport.prototype */{ newBounds = this._applyBoundaryConstraints( newBounds, immediately ); } - if ( newZoom == oldZoom || newBounds.width == oldBounds.width ) { + if (Math.abs(newZoom - oldZoom) < 0.00000000001 || + Math.abs(newBounds.width - oldBounds.width) < 0.00000000001) { return this.panTo( constraints ? newBounds.getCenter() : center, immediately ); }