Browse Source

Fixed issue in network/images.js where load() would return undefined if image was already loaded

v3_develop
Brendon Page 9 years ago
parent
commit
7f60681596
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      lib/network/Images.js

+ 3
- 2
lib/network/Images.js View File

@ -23,10 +23,11 @@ Images.prototype.setOnloadCallback = function(callback) {
* @return {Image} img The image object * @return {Image} img The image object
*/ */
Images.prototype.load = function(url, brokenUrl) { Images.prototype.load = function(url, brokenUrl) {
if (this.images[url] == undefined) {
var img = this.images[url];
if (img === undefined) {
// create the image // create the image
var me = this; var me = this;
var img = new Image();
img = new Image();
img.onload = function () { img.onload = function () {
// IE11 fix -- thanks dponch! // IE11 fix -- thanks dponch!

Loading…
Cancel
Save