From 34d4115061e56e17c4228079e3e8a897e3ec6128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Mon, 4 Jan 2016 11:12:56 +0100 Subject: [PATCH] Do not modify children array directly Use Item#remove() to remove children, to make sure indices are kept in sync. --- src/path/CompoundPath.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/path/CompoundPath.js b/src/path/CompoundPath.js index e01b7a00..81880657 100644 --- a/src/path/CompoundPath.js +++ b/src/path/CompoundPath.js @@ -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);