mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-27 14:33:59 +00:00
Include sourcePath in fabric.PathGroup only if its defined
Doc additions
This commit is contained in:
parent
61835602f9
commit
922e7ab159
1 changed files with 9 additions and 6 deletions
|
|
@ -109,19 +109,22 @@
|
|||
|
||||
/**
|
||||
* Returns object representation of this path group
|
||||
* @param {Array} [propertiesToInclude]
|
||||
* @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output
|
||||
* @return {Object} object representation of an instance
|
||||
*/
|
||||
toObject: function(propertiesToInclude) {
|
||||
return extend(parentToObject.call(this, propertiesToInclude), {
|
||||
paths: invoke(this.getObjects(), 'toObject', propertiesToInclude),
|
||||
sourcePath: this.sourcePath
|
||||
var o = extend(parentToObject.call(this, propertiesToInclude), {
|
||||
paths: invoke(this.getObjects(), 'toObject', propertiesToInclude)
|
||||
});
|
||||
if (this.sourcePath) {
|
||||
o.sourcePath = this.sourcePath;
|
||||
}
|
||||
return o;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns dataless object representation of this path group
|
||||
* @param {Array} [propertiesToInclude]
|
||||
* @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output
|
||||
* @return {Object} dataless object representation of an instance
|
||||
*/
|
||||
toDatalessObject: function(propertiesToInclude) {
|
||||
|
|
@ -198,7 +201,7 @@
|
|||
* Creates fabric.PathGroup instance from an object representation
|
||||
* @static
|
||||
* @memberOf fabric.PathGroup
|
||||
* @param {Object} object
|
||||
* @param {Object} object Object to create an instance from
|
||||
* @param {Function} callback Callback to invoke when an fabric.PathGroup instance is created
|
||||
*/
|
||||
fabric.PathGroup.fromObject = function(object, callback) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue