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:
Jürg Lehni 2016-01-04 11:12:56 +01:00
parent 1543d056a7
commit 34d4115061

View file

@ -148,7 +148,7 @@ var CompoundPath = PathItem.extend(/** @lends CompoundPath# */{
for (var i = children.length - 1; i >= 0; i--) {
var path = children[i].reduce();
if (path.isEmpty())
children.splice(i, 1);
path.remove();
}
if (children.length === 0) { // Replace with a simple empty Path
var path = new Path(Item.NO_INSERT);