This commit is contained in:
Larissa Smith 2015-09-11 15:37:11 -06:00
commit f4be8f859e
4 changed files with 14 additions and 15 deletions

View File

@ -20,6 +20,7 @@ OPENSEADRAGON CHANGELOG
* Now avoiding using eval when JSON.parse is available (#696)
* Rotation now works properly on retina display (#708)
* Added option in addTiledImage to replace tiledImage at index (#706)
* Changed resize behaviour to prevent "snapping" to world bounds when constraints allow more space (#711)
2.0.0:

View File

@ -108,7 +108,9 @@ $.Navigator = function( options ){
immediateRender: true,
blendTime: 0,
animationTime: 0,
autoResize: options.autoResize
autoResize: options.autoResize,
// prevent resizing the navigator from adding unwanted space around the image
minZoomImageRatio: 1.0
});
options.minPixelRatio = this.minPixelRatio = viewer.minPixelRatio;

View File

@ -241,7 +241,7 @@
* @property {Number} [minZoomImageRatio=0.9]
* The minimum percentage ( expressed as a number between 0 and 1 ) of
* the viewport height or width at which the zoom out will be constrained.
* Setting it to 0, for example will allow you to zoom out infinitly.
* Setting it to 0, for example will allow you to zoom out infinity.
*
* @property {Number} [maxZoomPixelRatio=1.1]
* The maximum ratio to allow a zoom-in to affect the highest level pixel
@ -356,7 +356,7 @@
* @property {Boolean} [showNavigator=false]
* Set to true to make the navigator minimap appear.
*
* @property {Boolean} [navigatorId=navigator-GENERATED DATE]
* @property {String} [navigatorId=navigator-GENERATED DATE]
* The ID of a div to hold the navigator minimap.
* If an ID is specified, the navigatorPosition, navigatorSizeRatio, navigatorMaintainSizeRatio, and navigatorTop|Left|Height|Width options will be ignored.
* If an ID is not specified, a div element will be generated and placed on top of the main image.

View File

@ -2965,19 +2965,15 @@ function resizeViewportAndRecenter( viewer, containerSize, oldBounds, oldCenter
viewport.resize( containerSize, true );
// We try to remove blanks as much as possible
var worldBounds = viewer.world.getHomeBounds();
var newWidth = oldBounds.width <= worldBounds.width ? oldBounds.width : worldBounds.width;
var newHeight = oldBounds.height <= worldBounds.height ?
oldBounds.height : worldBounds.height;
var newBounds = new $.Rect(
oldCenter.x - ( newWidth / 2.0 ),
oldCenter.y - ( newHeight / 2.0 ),
newWidth,
newHeight
);
viewport.fitBounds( newBounds, true );
oldCenter.x - ( oldBounds.width / 2.0 ),
oldCenter.y - ( oldBounds.height / 2.0 ),
oldBounds.width,
oldBounds.height
);
// let the viewport decide if the bounds are too big or too small
viewport.fitBoundsWithConstraints( newBounds, true );
}
function drawWorld( viewer ) {