diff --git a/src/tiledimage.js b/src/tiledimage.js index dbcddd75..cb908cbd 100644 --- a/src/tiledimage.js +++ b/src/tiledimage.js @@ -1404,7 +1404,7 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag this._loadTile(tile, currentTime); } }, this); - + this._needsDraw = true; return false; } else { @@ -2145,6 +2145,30 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag return previousBest; }, + /** + * @private + * @inner + * Sorts tiles in an array according to distance and visibility. + * + * @param {OpenSeadragon.Tile[]} tiles The tiles. + */ + _sortTiles: function( tiles ) { + tiles.sort(function (a, b) { + if (a === null) { + return 1; + } + if (b === null) { + return -1; + } + if (a.visibility === b.visibility) { + return (a.squaredDistance - b.squaredDistance); + } else { + return (a.visibility - b.visibility); + } + }); + }, + + /** * @private * @inner diff --git a/test/demo/drawercomparison.js b/test/demo/drawercomparison.js index 4b827118..96793915 100644 --- a/test/demo/drawercomparison.js +++ b/test/demo/drawercomparison.js @@ -58,18 +58,18 @@ let viewer2 = window.viewer2 = OpenSeadragon({ }); // // viewer3: html drawer, unused -// var viewer3 = window.viewer3 = OpenSeadragon({ -// id: "htmldrawer", -// drawer:'html', -// blendTime:2, -// prefixUrl: "../../build/openseadragon/images/", -// minZoomImageRatio:0.01, -// customDrawer: OpenSeadragon.HTMLDrawer, -// tileSources: [sources['leaves'], sources['rainbow'], sources['duomo']], -// sequenceMode: true, -// crossOriginPolicy: 'Anonymous', -// ajaxWithCredentials: false -// }); +var viewer3 = window.viewer3 = OpenSeadragon({ + id: "htmldrawer", + drawer:'html', + blendTime:2, + prefixUrl: "../../build/openseadragon/images/", + minZoomImageRatio:0.01, + customDrawer: OpenSeadragon.HTMLDrawer, + tileSources: [sources['leaves'], sources['rainbow'], sources['duomo']], + sequenceMode: true, + crossOriginPolicy: 'Anonymous', + ajaxWithCredentials: false +}); // Sync navigation of viewer1 and viewer 2