mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
Added pollForResize option
Defaults to true.
This commit is contained in:
parent
d223c9d8e5
commit
c7971419e2
@ -56,6 +56,7 @@ OPENSEADRAGON CHANGELOG
|
|||||||
* Viewer.innerTracker.scrollHandler: preventDefaultAction == true prevents viewer zooming on mousewheel/pinch
|
* Viewer.innerTracker.scrollHandler: preventDefaultAction == true prevents viewer zooming on mousewheel/pinch
|
||||||
* Fixed: IE8 error with custom buttons - "Object doesn't support this action" (#279)
|
* Fixed: IE8 error with custom buttons - "Object doesn't support this action" (#279)
|
||||||
* Support IIIF servers that don't report tile dimensions (#286)
|
* Support IIIF servers that don't report tile dimensions (#286)
|
||||||
|
* Added a pollForResize option. Default is true. When set to false, the viewer takes no action when its container element is resized.
|
||||||
|
|
||||||
0.9.131:
|
0.9.131:
|
||||||
|
|
||||||
|
@ -174,6 +174,9 @@
|
|||||||
* image though it is less effective visually if the HTML5 Canvas is not
|
* image though it is less effective visually if the HTML5 Canvas is not
|
||||||
* availble on the viewing device.
|
* availble on the viewing device.
|
||||||
*
|
*
|
||||||
|
* @param {Boolean} [options.pollForResize=true]
|
||||||
|
* Set to false to prevent polling for viewer size changes. Useful for providing custom resize behavior.
|
||||||
|
*
|
||||||
* @param {Number} [options.visibilityRatio=0.5]
|
* @param {Number} [options.visibilityRatio=0.5]
|
||||||
* The percentage ( as a number from 0 to 1 ) of the source image which
|
* The percentage ( as a number from 0 to 1 ) of the source image which
|
||||||
* must be kept within the viewport. If the image is dragged beyond that
|
* must be kept within the viewport. If the image is dragged beyond that
|
||||||
@ -532,6 +535,7 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
|
|||||||
minZoomImageRatio: 0.9, //-> closer to 0 allows zoom out to infinity
|
minZoomImageRatio: 0.9, //-> closer to 0 allows zoom out to infinity
|
||||||
maxZoomPixelRatio: 1.1, //-> higher allows 'over zoom' into pixels
|
maxZoomPixelRatio: 1.1, //-> higher allows 'over zoom' into pixels
|
||||||
pixelsPerWheelLine: 40,
|
pixelsPerWheelLine: 40,
|
||||||
|
pollForResize: true,
|
||||||
|
|
||||||
//DEFAULT CONTROL SETTINGS
|
//DEFAULT CONTROL SETTINGS
|
||||||
showSequenceControl: true, //SEQUENCE
|
showSequenceControl: true, //SEQUENCE
|
||||||
|
@ -1657,6 +1657,7 @@ function updateOnce( viewer ) {
|
|||||||
|
|
||||||
//viewer.profiler.beginUpdate();
|
//viewer.profiler.beginUpdate();
|
||||||
|
|
||||||
|
if ( viewer.pollForResize ) {
|
||||||
containerSize = _getSafeElemSize( viewer.container );
|
containerSize = _getSafeElemSize( viewer.container );
|
||||||
if ( !containerSize.equals( THIS[ viewer.hash ].prevContainerSize ) ) {
|
if ( !containerSize.equals( THIS[ viewer.hash ].prevContainerSize ) ) {
|
||||||
// maintain image position
|
// maintain image position
|
||||||
@ -1666,6 +1667,7 @@ function updateOnce( viewer ) {
|
|||||||
THIS[ viewer.hash ].prevContainerSize = containerSize;
|
THIS[ viewer.hash ].prevContainerSize = containerSize;
|
||||||
THIS[ viewer.hash ].forceRedraw = true;
|
THIS[ viewer.hash ].forceRedraw = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
animated = viewer.viewport.update();
|
animated = viewer.viewport.update();
|
||||||
|
|
||||||
|
@ -611,7 +611,7 @@ $.Viewport.prototype = {
|
|||||||
resize: function( newContainerSize, maintain ) {
|
resize: function( newContainerSize, maintain ) {
|
||||||
var oldBounds = this.getBounds(),
|
var oldBounds = this.getBounds(),
|
||||||
newBounds = oldBounds,
|
newBounds = oldBounds,
|
||||||
widthDeltaFactor = newContainerSize.x / this.containerSize.x;
|
widthDeltaFactor;
|
||||||
|
|
||||||
this.containerSize = new $.Point(
|
this.containerSize = new $.Point(
|
||||||
newContainerSize.x,
|
newContainerSize.x,
|
||||||
@ -619,6 +619,7 @@ $.Viewport.prototype = {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if ( maintain ) {
|
if ( maintain ) {
|
||||||
|
widthDeltaFactor = newContainerSize.x / this.containerSize.x;
|
||||||
newBounds.width = oldBounds.width * widthDeltaFactor;
|
newBounds.width = oldBounds.width * widthDeltaFactor;
|
||||||
newBounds.height = newBounds.width / this.getAspectRatio();
|
newBounds.height = newBounds.width / this.getAspectRatio();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user