Only change #clockwise on closed Paths when inserting into CompoundPaths.

This commit is contained in:
Jürg Lehni 2013-01-20 15:48:06 -08:00
parent c5ede2e955
commit 677ea374c5

View file

@ -54,14 +54,14 @@ var CompoundPath = this.CompoundPath = PathItem.extend(/** @lends CompoundPath#
// Only allow the insertion of paths
if (item._type !== 'path')
return null;
var res = this.base(index, item);
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 (!_cloning && res && item._clockwise === undefined)
if (!_cloning && item && item._closed && item._clockwise === undefined)
item.setClockwise(item._index == 0);
return res;
return item;
},
/**