mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-21 20:56:09 +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
|
||||
*/
|
||||
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,
|
||||
showNavigator: testNavigator,
|
||||
useCanvas: true,
|
||||
// defaultZoomLevel: 2,
|
||||
// homeFillsViewer: true,
|
||||
// sequenceMode: true,
|
||||
// showReferenceStrip: true,
|
||||
// referenceStripScroll: 'vertical',
|
||||
@ -70,7 +72,10 @@
|
||||
}
|
||||
];
|
||||
|
||||
// config.tileSources = highsmith;
|
||||
// config.tileSources = {
|
||||
// tileSource: highsmith,
|
||||
// width: 1
|
||||
// };
|
||||
}
|
||||
|
||||
if (testOverlays) {
|
||||
|
@ -207,7 +207,7 @@
|
||||
method: 'getHomeBounds',
|
||||
processExpected: function(level, expected) {
|
||||
// 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);
|
||||
} else {
|
||||
var sideLength = 1.0 / viewer.defaultZoomLevel; // it's a square in this case
|
||||
|
Loading…
Reference in New Issue
Block a user