mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
Fixed broken defaultZoomLevel and homeFillsViewer options
This commit is contained in:
parent
cd329016bb
commit
a7d9f7dcd5
@ -230,7 +230,16 @@ $.Viewport.prototype = /** @lends OpenSeadragon.Viewport.prototype */{
|
|||||||
* @function
|
* @function
|
||||||
*/
|
*/
|
||||||
getHomeBounds: function() {
|
getHomeBounds: function() {
|
||||||
return this.homeBounds.clone();
|
var center = this.homeBounds.getCenter( ),
|
||||||
|
width = 1.0 / this.getHomeZoom( ),
|
||||||
|
height = width / this.getAspectRatio();
|
||||||
|
|
||||||
|
return new $.Rect(
|
||||||
|
center.x - ( width / 2.0 ),
|
||||||
|
center.y - ( height / 2.0 ),
|
||||||
|
width,
|
||||||
|
height
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
zoomPerScroll: 1.02,
|
zoomPerScroll: 1.02,
|
||||||
showNavigator: testNavigator,
|
showNavigator: testNavigator,
|
||||||
useCanvas: true,
|
useCanvas: true,
|
||||||
|
// defaultZoomLevel: 2,
|
||||||
|
// homeFillsViewer: true,
|
||||||
// sequenceMode: true,
|
// sequenceMode: true,
|
||||||
// showReferenceStrip: true,
|
// showReferenceStrip: true,
|
||||||
// referenceStripScroll: 'vertical',
|
// referenceStripScroll: 'vertical',
|
||||||
@ -70,7 +72,10 @@
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
// config.tileSources = highsmith;
|
// config.tileSources = {
|
||||||
|
// tileSource: highsmith,
|
||||||
|
// width: 1
|
||||||
|
// };
|
||||||
}
|
}
|
||||||
|
|
||||||
if (testOverlays) {
|
if (testOverlays) {
|
||||||
|
@ -207,7 +207,7 @@
|
|||||||
method: 'getHomeBounds',
|
method: 'getHomeBounds',
|
||||||
processExpected: function(level, expected) {
|
processExpected: function(level, expected) {
|
||||||
// Have to special case this to avoid dividing by 0
|
// Have to special case this to avoid dividing by 0
|
||||||
if(level === 0){
|
if(level === -1 || level === 0){
|
||||||
expected = new OpenSeadragon.Rect(0, 0, 1, 1);
|
expected = new OpenSeadragon.Rect(0, 0, 1, 1);
|
||||||
} else {
|
} else {
|
||||||
var sideLength = 1.0 / viewer.defaultZoomLevel; // it's a square in this case
|
var sideLength = 1.0 / viewer.defaultZoomLevel; // it's a square in this case
|
||||||
|
Loading…
Reference in New Issue
Block a user