mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 05:06:09 +03:00
Merge branch 'master' into merger
fixed Conflicts: src/drawer.js
This commit is contained in:
commit
30a1005fb8
@ -50,6 +50,7 @@ OPENSEADRAGON CHANGELOG
|
|||||||
* Viewport.setRotation now allows all rotation angles (#466)
|
* Viewport.setRotation now allows all rotation angles (#466)
|
||||||
* Pinch rotate is now available (defaults to off) (#468)
|
* Pinch rotate is now available (defaults to off) (#468)
|
||||||
* Added option for home button to fill viewer (#474)
|
* Added option for home button to fill viewer (#474)
|
||||||
|
* Better handling of mid-update image loaded callbacks (#409)
|
||||||
|
|
||||||
1.1.1:
|
1.1.1:
|
||||||
|
|
||||||
|
@ -36,6 +36,12 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @class Drawer
|
* @class Drawer
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
* @classdesc Handles rendering of tiles for an {@link OpenSeadragon.Viewer}.
|
||||||
|
* A new instance is created for each TileSource opened (see {@link OpenSeadragon.Viewer#drawer}).
|
||||||
|
*
|
||||||
|
>>>>>>> master
|
||||||
* @memberof OpenSeadragon
|
* @memberof OpenSeadragon
|
||||||
* @classdesc Handles rendering of tiles for an {@link OpenSeadragon.Viewer}.
|
* @classdesc Handles rendering of tiles for an {@link OpenSeadragon.Viewer}.
|
||||||
* @param {Object} options - Options for this Drawer.
|
* @param {Object} options - Options for this Drawer.
|
||||||
|
@ -133,7 +133,14 @@ $.ImageLoader.prototype = /** @lends OpenSeadragon.ImageLoader.prototype */{
|
|||||||
else {
|
else {
|
||||||
this.jobQueue.push( newJob );
|
this.jobQueue.push( newJob );
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear any unstarted image loading jobs from the queue.
|
||||||
|
* @method
|
||||||
|
*/
|
||||||
|
clear: function() {
|
||||||
|
this.jobQueue = [];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -571,31 +571,40 @@ function loadTile( tiledImage, tile, time ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onTileLoad( tiledImage, tile, time, image ) {
|
function onTileLoad( tiledImage, tile, time, image ) {
|
||||||
tile.loading = false;
|
if ( !image ) {
|
||||||
|
|
||||||
if ( tiledImage.midUpdate ) {
|
|
||||||
$.console.warn( "Tile load callback in middle of drawing routine." );
|
|
||||||
return;
|
|
||||||
} else if ( !image ) {
|
|
||||||
$.console.log( "Tile %s failed to load: %s", tile, tile.url );
|
$.console.log( "Tile %s failed to load: %s", tile, tile.url );
|
||||||
if( !tiledImage.debugMode ){
|
if( !tiledImage.debugMode ){
|
||||||
|
tile.loading = false;
|
||||||
tile.exists = false;
|
tile.exists = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if ( time < tiledImage.lastResetTime ) {
|
} else if ( time < tiledImage.lastResetTime ) {
|
||||||
$.console.log( "Ignoring tile %s loaded before reset: %s", tile, tile.url );
|
$.console.log( "Ignoring tile %s loaded before reset: %s", tile, tile.url );
|
||||||
|
tile.loading = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
tile.loaded = true;
|
var finish = function() {
|
||||||
tile.image = image;
|
tile.loading = false;
|
||||||
|
tile.loaded = true;
|
||||||
|
tile.image = image;
|
||||||
|
|
||||||
var cutoff = Math.ceil( Math.log( tiledImage.source.getTileSize(tile.level) ) / Math.log( 2 ) );
|
var cutoff = Math.ceil( Math.log( tiledImage.source.getTileSize(tile.level) ) / Math.log( 2 ) );
|
||||||
tiledImage._tileCache.cacheTile({
|
tiledImage._tileCache.cacheTile({
|
||||||
tile: tile,
|
tile: tile,
|
||||||
cutoff: cutoff,
|
cutoff: cutoff,
|
||||||
tiledImage: tiledImage
|
tiledImage: tiledImage
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// Check if we're mid-update; this can happen on IE8 because image load events for
|
||||||
|
// cached images happen immediately there
|
||||||
|
if ( !tiledImage.midUpdate ) {
|
||||||
|
finish();
|
||||||
|
} else {
|
||||||
|
// Wait until after the update, in case caching unloads any tiles
|
||||||
|
window.setTimeout( finish, 1);
|
||||||
|
}
|
||||||
|
|
||||||
tiledImage.updateAgain = true;
|
tiledImage.updateAgain = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user