Reducing an empty CompoundPath should replace it with an empty Path.

This commit is contained in:
Jürg Lehni 2015-01-03 00:46:45 +01:00
parent e195db2567
commit 5e654ca64e

View file

@ -131,6 +131,18 @@ var CompoundPath = PathItem.extend(/** @lends CompoundPath# */{
this._children[i].smooth();
},
reduce: function reduce() {
if (this._children.length === 0) { // Replace with a simple empty Path
var path = new Path(Item.NO_INSERT);
path.insertAbove(this);
path.setStyle(this._style);
this.remove();
return path;
} else {
return reduce.call(this);
}
},
/**
* Specifies whether the compound path is oriented clock-wise.
*