Fix CompoundPath#insertChild.

It was not returning success values and thus broke some tests.
This commit is contained in:
Jürg Lehni 2012-10-10 19:54:32 -07:00
parent 8dbd2c25bf
commit adb2ddc615

View file

@ -53,13 +53,14 @@ var CompoundPath = this.CompoundPath = PathItem.extend(/** @lends CompoundPath#
},
insertChild: function(index, item) {
this.base(index, item);
var res = 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)
if (res && item._clockwise === undefined)
item.setClockwise(item._index == 0);
return res;
},
/**