mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-01-31 15:12:07 +03:00
Pass the correct object to image load callbacks.
Previously, the image object was passed on to onTileLoad regardless if it loaded successfully or not. In case an image failed to load, this would result in trying to draw a non-existing image onto the canvas, which (at least in Firefox) throws a DOM exception and results in the drawer being stuck mid-update.
This commit is contained in:
parent
5c74c7b415
commit
bb0ac1f9d1
@ -7977,11 +7977,11 @@ $.Drawer.prototype = {
|
||||
|
||||
image = new Image();
|
||||
|
||||
complete = function( imagesrc ){
|
||||
complete = function( imagesrc, img ){
|
||||
_this.downloading--;
|
||||
if (typeof ( callback ) == "function") {
|
||||
try {
|
||||
callback( image );
|
||||
callback( img );
|
||||
} catch ( e ) {
|
||||
$.console.error(
|
||||
"%s while executing %s callback: %s",
|
||||
|
@ -293,11 +293,11 @@ $.Drawer.prototype = {
|
||||
|
||||
image = new Image();
|
||||
|
||||
complete = function( imagesrc ){
|
||||
complete = function( imagesrc, img ){
|
||||
_this.downloading--;
|
||||
if (typeof ( callback ) == "function") {
|
||||
try {
|
||||
callback( image );
|
||||
callback( img );
|
||||
} catch ( e ) {
|
||||
$.console.error(
|
||||
"%s while executing %s callback: %s",
|
||||
|
Loading…
x
Reference in New Issue
Block a user