diff options
author | wout <wout@impinc.co.uk> | 2014-09-02 14:47:02 +0200 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2014-09-02 14:47:02 +0200 |
commit | 826649995f1aae806fb9bf8464a4259c4290c4fb (patch) | |
tree | 9f4fb1585990bec8e1b90963c5932944561f454b /src/image.js | |
parent | 5aa85e605368e4e30c4fcb62abb0031543a7d633 (diff) | |
download | svg.js-826649995f1aae806fb9bf8464a4259c4290c4fb.tar.gz svg.js-826649995f1aae806fb9bf8464a4259c4290c4fb.zip |
Fixed bug in clone() method
Diffstat (limited to 'src/image.js')
-rwxr-xr-x | src/image.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/image.js b/src/image.js index 33f3979..ed44752 100755 --- a/src/image.js +++ b/src/image.js @@ -14,19 +14,19 @@ SVG.Image = SVG.invent({ var self = this , img = document.createElement('img') - /* preload image */ + // preload image img.onload = function() { var p = self.doc(SVG.Pattern) - /* ensure image size */ + // ensure image size if (self.width() == 0 && self.height() == 0) self.size(img.width, img.height) - /* ensure pattern size if not set */ + // ensure pattern size if not set if (p && p.width() == 0 && p.height() == 0) p.size(self.width(), self.height()) - /* callback */ + // callback if (typeof self._loaded === 'function') self._loaded.call(self, { width: img.width @@ -38,7 +38,7 @@ SVG.Image = SVG.invent({ return this.attr('href', (img.src = this.src = url), SVG.xlink) } - // Add loade callback + // Add loaded callback , loaded: function(loaded) { this._loaded = loaded return this @@ -47,7 +47,7 @@ SVG.Image = SVG.invent({ // Add parent method , construct: { - // Create image element, load image and set its size + // create image element, load image and set its size image: function(source, width, height) { return this.put(new SVG.Image).load(source).size(width || 0, height || width || 0) } |