diff --git a/src/browser/DomEvent.js b/src/browser/DomEvent.js index 0db05d93..771c3ac6 100644 --- a/src/browser/DomEvent.js +++ b/src/browser/DomEvent.js @@ -84,7 +84,7 @@ var DomEvent = { stop: function(event) { DomEvent.stopPropagation(event); DomEvent.preventDefault(event); - }, + } }; DomEvent.requestAnimationFrame = new function() { diff --git a/src/path/CompoundPath.js b/src/path/CompoundPath.js index 93fa12f2..54223ddb 100644 --- a/src/path/CompoundPath.js +++ b/src/path/CompoundPath.js @@ -49,17 +49,17 @@ var CompoundPath = this.CompoundPath = PathItem.extend(/** @lends CompoundPath# // we potentially use as array, depending on what is passed. var items = !paths || !Array.isArray(paths) || typeof paths[0] !== 'object' ? arguments : paths; - for (var i = 0, l = items.length; i < l; i++) { - var path = items[i]; - // All paths except for the top one (last one in list) are set to - // clockwise orientation when creating a compound path, so that they - // appear as holes, but only if their orientation was not already - // specified before (= _clockwise is defined). - // TODO: Should this be handled in appendTop / Bottom instead? - if (path._clockwise === undefined) - path.setClockwise(i < l - 1); - this.addChild(path); - } + this.addChildren(items); + }, + + insertChild: function(index, item) { + this.base(index, item); + // All children except for the bottom one (first one in list) are set + // to anti-clockwise orientation, so that they appear as holes, but + // only if their orientation was not already specified before + // (= _clockwise is defined). + if (item._clockwise === undefined) + item.setClockwise(item._index == 0); }, /**