diff --git a/src/imagecontainer.js b/src/imagecontainer.js index d0a1fca..07bb26a 100644 --- a/src/imagecontainer.js +++ b/src/imagecontainer.js @@ -9,5 +9,8 @@ function ImageContainer(src, cors) { image.crossOrigin = "anonymous"; } image.src = src; + if (image.complete === true) { + resolve(image); + } }); } diff --git a/src/nodecontainer.js b/src/nodecontainer.js index a4fed48..d428048 100644 --- a/src/nodecontainer.js +++ b/src/nodecontainer.js @@ -28,12 +28,12 @@ NodeContainer.prototype.css = function(attribute) { NodeContainer.prototype.cssInt = function(attribute) { var value = parseInt(this.css(attribute), 10); - return (Number.isNaN(value)) ? 0 : value; // borders in old IE are throwing 'medium' for demo.html + return (isNaN(value)) ? 0 : value; // borders in old IE are throwing 'medium' for demo.html }; NodeContainer.prototype.cssFloat = function(attribute) { var value = parseFloat(this.css(attribute)); - return (Number.isNaN(value)) ? 0 : value; + return (isNaN(value)) ? 0 : value; }; NodeContainer.prototype.fontWeight = function() {