mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-04 03:45:58 -05:00
Use #setChildren() in Group constructor and allow passing of children both as arguments and inside an array.
This commit is contained in:
parent
baf35ea18c
commit
889b1687f9
1 changed files with 2 additions and 5 deletions
|
@ -21,12 +21,9 @@ var Group = this.Group = Item.extend({
|
|||
this.base();
|
||||
this._children = [];
|
||||
this._namedChildren = {};
|
||||
if (items) {
|
||||
for (var i = 0, l = items.length; i < l; i++) {
|
||||
this.appendTop(items[i]);
|
||||
}
|
||||
}
|
||||
this._clipped = false;
|
||||
this.setChildren(!items || !Array.isArray(items)
|
||||
|| typeof items[0] !== 'object' ? arguments : items);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue