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 ); }