mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-24 22:26:10 +03:00
Added Rect.union; allowed minZoomLevel greater than home zoom
This commit is contained in:
parent
ef20ccc1e7
commit
e4c3dfc8dd
@ -40,6 +40,8 @@ OPENSEADRAGON CHANGELOG
|
|||||||
* Overlays appear in the DOM immediately on open or addOverlay (#507)
|
* Overlays appear in the DOM immediately on open or addOverlay (#507)
|
||||||
* imageLoaderLimit now works (#544)
|
* imageLoaderLimit now works (#544)
|
||||||
* Turning off scrollToZoom in gestureSettings now allows scroll events to propagate
|
* 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
|
||||||
|
|
||||||
1.2.1: (in progress)
|
1.2.1: (in progress)
|
||||||
|
|
||||||
|
@ -201,6 +201,21 @@ $.Rect.prototype = /** @lends OpenSeadragon.Rect.prototype */{
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the smallest rectangle that will contain this and the given rectangle.
|
||||||
|
* @param {OpenSeadragon.Rect} rect
|
||||||
|
* @return {OpenSeadragon.Rect} The new rectangle.
|
||||||
|
*/
|
||||||
|
// ----------
|
||||||
|
union: function(rect) {
|
||||||
|
var left = Math.min(this.x, rect.x);
|
||||||
|
var top = Math.min(this.y, rect.y);
|
||||||
|
var right = Math.max(this.x + this.width, rect.x + rect.width);
|
||||||
|
var bottom = Math.max(this.y + this.height, rect.y + rect.height);
|
||||||
|
|
||||||
|
return new OpenSeadragon.Rect(left, top, right - left, bottom - top);
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rotates a rectangle around a point. Currently only 90, 180, and 270
|
* Rotates a rectangle around a point. Currently only 90, 180, and 270
|
||||||
* degrees are supported.
|
* degrees are supported.
|
||||||
|
@ -275,7 +275,7 @@ $.Viewport.prototype = /** @lends OpenSeadragon.Viewport.prototype */{
|
|||||||
this.minZoomLevel :
|
this.minZoomLevel :
|
||||||
this.minZoomImageRatio * homeZoom;
|
this.minZoomImageRatio * homeZoom;
|
||||||
|
|
||||||
return Math.min( zoom, homeZoom );
|
return zoom;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user