Skip to content

Commit

Permalink
Update path.class.js (#3713)
Browse files Browse the repository at this point in the history
  • Loading branch information
asturur authored Feb 19, 2017
1 parent 74d8e02 commit f85bdc7
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions src/shapes/path.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -927,23 +927,7 @@
* @param {Boolean} [forceAsync] Force an async behaviour trying to create pattern first
*/
fabric.Path.fromObject = function(object, callback, forceAsync) {
// remove this pattern rom 2.0, accept just object.
var path;
if (typeof object.path === 'string') {
fabric.loadSVGFromURL(object.path, function (elements) {
var pathUrl = object.path;
path = elements[0];
delete object.path;

fabric.util.object.extend(path, object);
path.setSourcePath(pathUrl);

callback && callback(path);
});
}
else {
return fabric.Object._fromObject('Path', object, callback, forceAsync, 'path');
}
return fabric.Object._fromObject('Path', object, callback, forceAsync, 'path');
};

/* _FROM_SVG_START_ */
Expand Down

0 comments on commit f85bdc7

Please sign in to comment.