Merge pull request #1492 from openseadragon/dzi

Making the DziTileSource honor minLevel.
This commit is contained in:
Ian Gilman 2018-07-06 15:43:03 -07:00 committed by GitHub
commit 2bc102de33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -19,6 +19,7 @@ OPENSEADRAGON CHANGELOG
* You can now prevent canvas-drag events on the navigator (#1484) * You can now prevent canvas-drag events on the navigator (#1484)
* You can now prevent canvas-click events on the navigator (#1416) * You can now prevent canvas-click events on the navigator (#1416)
* The navigator can now be restricted to just horizontal or just vertical panning (#1416) * The navigator can now be restricted to just horizontal or just vertical panning (#1416)
* Fixed DziTileSource so it doesn't load levels above maxLevel or below minLevel, if set (#1492)
2.3.1: 2.3.1:

View File

@ -182,6 +182,10 @@ $.extend( $.DziTileSource.prototype, $.TileSource.prototype, /** @lends OpenSead
yMax, yMax,
i; i;
if ((this.minLevel && level < this.minLevel) || (this.maxLevel && level > this.maxLevel)) {
return false;
}
if ( !rects || !rects.length ) { if ( !rects || !rects.length ) {
return true; return true;
} }

View File

@ -972,6 +972,7 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
// Calculations for the interval of levels to draw // Calculations for the interval of levels to draw
// can return invalid intervals; fix that here if necessary // can return invalid intervals; fix that here if necessary
highestLevel = Math.max(highestLevel, this.source.minLevel || 0);
lowestLevel = Math.min(lowestLevel, highestLevel); lowestLevel = Math.min(lowestLevel, highestLevel);
return { return {
lowestLevel: lowestLevel, lowestLevel: lowestLevel,