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:
Ventero 2012-09-29 12:14:27 +02:00
parent 5c74c7b415
commit bb0ac1f9d1
2 changed files with 4 additions and 4 deletions

View File

@ -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",

View File

@ -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",