From d5c431b1cd0b77522720d366efd177ab09b4497d Mon Sep 17 00:00:00 2001 From: Antoine Vandecreme Date: Wed, 3 Jun 2015 14:40:20 -0400 Subject: [PATCH] Integrate Ian's comments. --- changelog.txt | 5 +++-- src/tiledimage.js | 10 ++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/changelog.txt b/changelog.txt index e5b00e19..9c784bdd 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,8 +2,9 @@ OPENSEADRAGON CHANGELOG ======================= 2.0.1: (in progress) - * BREAKING CHANGE: the tile does not hold a reference to its image anymore. Only the tile cache keep a reference to images. - * DEPRECATION: let ImageRecord.getRenderedContext create the rendered context instead of using ImageRecord.setRenderedContext. +* BREAKING CHANGE: the tile does not hold a reference to its image anymore. Only the tile cache keep a reference to images. +* DEPRECATION: let ImageRecord.getRenderedContext create the rendered context instead of using ImageRecord.setRenderedContext. +* Added "tile-loaded" event on the viewer allowing to modify a tile before it is marked ready to be drawn. (#659) * Fix flickering tiles with useCanvas=false when no cache is used. (#661) 2.0.0: diff --git a/src/tiledimage.js b/src/tiledimage.js index 195d00d0..b843ca78 100644 --- a/src/tiledimage.js +++ b/src/tiledimage.js @@ -971,8 +971,6 @@ function onTileLoad( tiledImage, tile, time, image ) { // Wait until after the update, in case caching unloads any tiles window.setTimeout( finish, 1); } - - tiledImage._needsDraw = true; } function setTileLoaded(tiledImage, tile, image, cutoff) { @@ -994,13 +992,13 @@ function setTileLoaded(tiledImage, tile, image, cutoff) { cutoff: cutoff, tiledImage: tiledImage }); + tiledImage._needsDraw = true; } } /** * Triggered when a tile has just been loaded in memory. That means that the - * image has been downloaded and can be modified asynchronously before being - * drawn to the canvas. + * image has been downloaded and can be modified before being drawn to the canvas. * * @event tile-loaded * @memberof OpenSeadragon.Viewer @@ -1010,8 +1008,8 @@ function setTileLoaded(tiledImage, tile, image, cutoff) { * @property {OpenSeadragon.Tile} tile - The tile which has been loaded. * @property {function} getCompletionCallback - A function giving a callback to call * when the asynchronous processing of the image is done. The image will be - * marked as entirely loaded once the callback has been called as many times as - * getCompletionCallback + * marked as .entirely loaded when the callback has been called once for each + * call to getCompletionCallback. */ tiledImage.viewer.raiseEvent("tile-loaded", { tile: tile,