mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 14:46:10 +03:00
Merge branch 'master' of github.com:openseadragon/openseadragon
This commit is contained in:
commit
63c066b6e5
@ -108,7 +108,9 @@ $.Navigator = function( options ){
|
|||||||
immediateRender: true,
|
immediateRender: true,
|
||||||
blendTime: 0,
|
blendTime: 0,
|
||||||
animationTime: 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;
|
options.minPixelRatio = this.minPixelRatio = viewer.minPixelRatio;
|
||||||
|
@ -2965,19 +2965,15 @@ function resizeViewportAndRecenter( viewer, containerSize, oldBounds, oldCenter
|
|||||||
|
|
||||||
viewport.resize( containerSize, true );
|
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(
|
var newBounds = new $.Rect(
|
||||||
oldCenter.x - ( newWidth / 2.0 ),
|
oldCenter.x - ( oldBounds.width / 2.0 ),
|
||||||
oldCenter.y - ( newHeight / 2.0 ),
|
oldCenter.y - ( oldBounds.height / 2.0 ),
|
||||||
newWidth,
|
oldBounds.width,
|
||||||
newHeight
|
oldBounds.height
|
||||||
);
|
);
|
||||||
viewport.fitBounds( newBounds, true );
|
|
||||||
|
// let the viewport decide if the bounds are too big or too small
|
||||||
|
viewport.fitBoundsWithConstraints( newBounds, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
function drawWorld( viewer ) {
|
function drawWorld( viewer ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user