mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Item#insertChild(): Only remove from parent if we're actually inserting the item in the new location.
This commit is contained in:
parent
6f4a9d5c7b
commit
85c5e2a7eb
1 changed files with 1 additions and 1 deletions
|
@ -1413,8 +1413,8 @@ var Item = this.Item = Base.extend({
|
|||
* @param {Item} item The item that will be appended as a child
|
||||
*/
|
||||
insertChild: function(index, item) {
|
||||
item._removeFromParent();
|
||||
if (this._children) {
|
||||
item._removeFromParent();
|
||||
Base.splice(this._children, [item], index, 0);
|
||||
item._parent = this;
|
||||
item._setProject(this._project);
|
||||
|
|
Loading…
Reference in a new issue