From ec28167906422dc7924ee582dc42c8443d9a8b0f Mon Sep 17 00:00:00 2001 From: Kienz Date: Tue, 19 Feb 2013 09:19:46 +0100 Subject: [PATCH] Fix for issue #433 - wrong width/height of image objects If svg with image objects was parsed the width/height props of the image were overridden by width/height of the svg file. --- src/image.class.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/image.class.js b/src/image.class.js index a905ee5e..2ec6d295 100644 --- a/src/image.class.js +++ b/src/image.class.js @@ -403,11 +403,9 @@ * @return {fabric.Image} */ fabric.Image.fromElement = function(element, callback, options) { - options || (options = { }); - var parsedAttributes = fabric.parseAttributes(element, fabric.Image.ATTRIBUTE_NAMES); - fabric.Image.fromURL(parsedAttributes['xlink:href'], callback, extend(parsedAttributes, options)); + fabric.Image.fromURL(parsedAttributes['xlink:href'], callback, extend((options ? fabric.util.object.clone(options) : { }), parsedAttributes)); }; /**