mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-22 15:04:41 +00:00
Build distribution
This commit is contained in:
parent
71f81f5b32
commit
aabad2af49
3 changed files with 10 additions and 20 deletions
26
dist/all.js
vendored
26
dist/all.js
vendored
|
|
@ -14409,7 +14409,8 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
|
|||
/**
|
||||
* Creates an instance of fabric.Path from an object
|
||||
* @static
|
||||
* @return {fabric.Path} Instance of fabric.Path
|
||||
* @param {Object} object
|
||||
* @param {Function} callback Callback to invoke when an fabric.Path instance is created
|
||||
*/
|
||||
fabric.Path.fromObject = function(object, callback) {
|
||||
if (typeof object.path === 'string') {
|
||||
|
|
@ -14442,8 +14443,8 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
|
|||
* Creates an instance of fabric.Path from an SVG <path> element
|
||||
* @static
|
||||
* @param {SVGElement} element to parse
|
||||
* @param {Function} callback Callback to invoke when an fabric.Path instance is created
|
||||
* @param {Object} [options] Options object
|
||||
* @return {fabric.Path} Instance of fabric.Path
|
||||
*/
|
||||
fabric.Path.fromElement = function(element, callback, options) {
|
||||
var parsedAttributes = fabric.parseAttributes(element, fabric.Path.ATTRIBUTE_NAMES);
|
||||
|
|
@ -14670,24 +14671,11 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
|
|||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
function instantiatePaths(paths) {
|
||||
for (var i = 0, len = paths.length; i < len; i++) {
|
||||
if (!(paths[i] instanceof fabric.Object)) {
|
||||
var klassName = camelize(capitalize(paths[i].type));
|
||||
paths[i] = fabric[klassName].fromObject(paths[i]);
|
||||
}
|
||||
}
|
||||
return paths;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates fabric.PathGroup instance from an object representation
|
||||
* @static
|
||||
* @param {Object} object
|
||||
* @return {fabric.PathGroup}
|
||||
* @param {Function} callback Callback to invoke when an fabric.PathGroup instance is created
|
||||
*/
|
||||
fabric.PathGroup.fromObject = function(object, callback) {
|
||||
if (typeof object.paths === 'string') {
|
||||
|
|
@ -14702,8 +14690,10 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
|
|||
});
|
||||
}
|
||||
else {
|
||||
var paths = instantiatePaths(object.paths);
|
||||
callback(new fabric.PathGroup(paths, object));
|
||||
fabric.util.enlivenObjects(object.paths, function(enlivenedObjects) {
|
||||
delete object.paths;
|
||||
callback(new fabric.PathGroup(enlivenedObjects, object));
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
4
dist/all.min.js
vendored
4
dist/all.min.js
vendored
File diff suppressed because one or more lines are too long
BIN
dist/all.min.js.gz
vendored
BIN
dist/all.min.js.gz
vendored
Binary file not shown.
Loading…
Reference in a new issue