mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 05:06:09 +03:00
Fixed _updateViewport to come to a fullyLoaded state with n tiles.
Improved _compareTiles
This commit is contained in:
parent
9684a83b8c
commit
ccb4ae9f86
@ -1276,7 +1276,7 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
|
||||
this._drawTiles(this.lastDrawn);
|
||||
|
||||
// Load the new 'best' n tiles
|
||||
if (bestTiles) {
|
||||
if (bestTiles && bestTiles.length > 0) {
|
||||
bestTiles.forEach(function (tile) {
|
||||
if (tile && !tile.context2D) {
|
||||
this._loadTile(tile, currentTime);
|
||||
@ -1930,6 +1930,7 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
|
||||
return [tile];
|
||||
}
|
||||
previousBest.push(tile);
|
||||
if (previousBest.length > maxNTiles) {
|
||||
previousBest.sort(function (a, b) {
|
||||
if (a === null) {
|
||||
return 1;
|
||||
@ -1943,7 +1944,6 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
|
||||
return (a.visibility - b.visibility);
|
||||
}
|
||||
});
|
||||
if (previousBest.length > maxNTiles) {
|
||||
previousBest.pop();
|
||||
}
|
||||
return previousBest;
|
||||
|
Loading…
Reference in New Issue
Block a user