mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-21 20:56:09 +03:00
Tracking tile loading separately from tile drawing
This commit is contained in:
parent
de2fcb1b74
commit
300ebbfe82
@ -146,7 +146,8 @@ $.TiledImage = function( options ) {
|
||||
//internal state properties
|
||||
viewer: null,
|
||||
tilesMatrix: {}, // A '3d' dictionary [level][x][y] --> Tile.
|
||||
coverage: {}, // A '3d' dictionary [level][x][y] --> Boolean.
|
||||
coverage: {}, // A '3d' dictionary [level][x][y] --> Boolean; shows what areas have been drawn.
|
||||
loadingCoverage: {}, // A '3d' dictionary [level][x][y] --> Boolean; shows what areas are loaded or are being loaded/blended.
|
||||
lastDrawn: [], // An unordered list of Tiles drawn last frame.
|
||||
lastResetTime: 0, // Last time for which the tiledImage was reset.
|
||||
_midDraw: false, // Is the tiledImage currently updating the viewport?
|
||||
@ -1122,6 +1123,7 @@ function updateLevel(tiledImage, haveDrawn, drawLevel, level, levelOpacity,
|
||||
}
|
||||
|
||||
resetCoverage(tiledImage.coverage, level);
|
||||
resetCoverage(tiledImage.loadingCoverage, level);
|
||||
|
||||
//OK, a new drawing so do your calculations
|
||||
var cornerTiles = tiledImage._getCornerTiles(level, topLeftBound, bottomRightBound);
|
||||
@ -1216,6 +1218,9 @@ function updateTile( tiledImage, haveDrawn, drawLevel, x, y, level, levelOpacity
|
||||
|
||||
setCoverage( tiledImage.coverage, level, x, y, false );
|
||||
|
||||
var loadingCoverage = tile.loaded || tile.loading || isCovered(tiledImage.loadingCoverage, level, x, y);
|
||||
setCoverage(tiledImage.loadingCoverage, level, x, y, loadingCoverage);
|
||||
|
||||
if ( !tile.exists ) {
|
||||
return best;
|
||||
}
|
||||
@ -1269,7 +1274,7 @@ function updateTile( tiledImage, haveDrawn, drawLevel, x, y, level, levelOpacity
|
||||
} else if ( tile.loading ) {
|
||||
// the tile is already in the download queue
|
||||
tiledImage._tilesLoading++;
|
||||
} else {
|
||||
} else if (!loadingCoverage) {
|
||||
best = compareTiles( best, tile );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user