Add support for _setProperties() to CompoundPath constructor.

This commit is contained in:
Jürg Lehni 2013-01-20 15:20:10 -08:00
parent ba5aa86411
commit c5ede2e955

View file

@ -41,14 +41,13 @@ var CompoundPath = this.CompoundPath = PathItem.extend(/** @lends CompoundPath#
* // Move the inner circle 5pt to the right:
* compoundPath.children[1].position.x += 5;
*/
initialize: function(paths) {
initialize: function(arg) {
this.base();
// Allow CompoundPath to have children and named children.
// CompoundPath has children and supports named children.
this._children = [];
this._namedChildren = {};
// Do not reassign to paths, since arguments would get modified, which
// we potentially use as array, depending on what is passed.
this.addChildren(Array.isArray(paths) ? paths : arguments);
if (!this._setProperties(arg))
this.addChildren(Array.isArray(arg) ? arg : arguments);
},
insertChild: function(index, item, _cloning) {