mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-04 03:45:58 -05:00
Do not modify children array directly
Use Item#remove() to remove children, to make sure indices are kept in sync.
This commit is contained in:
parent
1543d056a7
commit
34d4115061
1 changed files with 1 additions and 1 deletions
|
@ -148,7 +148,7 @@ var CompoundPath = PathItem.extend(/** @lends CompoundPath# */{
|
||||||
for (var i = children.length - 1; i >= 0; i--) {
|
for (var i = children.length - 1; i >= 0; i--) {
|
||||||
var path = children[i].reduce();
|
var path = children[i].reduce();
|
||||||
if (path.isEmpty())
|
if (path.isEmpty())
|
||||||
children.splice(i, 1);
|
path.remove();
|
||||||
}
|
}
|
||||||
if (children.length === 0) { // Replace with a simple empty Path
|
if (children.length === 0) { // Replace with a simple empty Path
|
||||||
var path = new Path(Item.NO_INSERT);
|
var path = new Path(Item.NO_INSERT);
|
||||||
|
|
Loading…
Reference in a new issue