* Fixed an error in fitBounds if the new and old bounds were extremely close in size

This commit is contained in:
Ian Gilman 2015-01-14 17:06:18 -08:00
parent fe2aa52caf
commit 3232ba4fe5
2 changed files with 3 additions and 1 deletions

View File

@ -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)

View File

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