Implement CompoundPath#closed.

This commit is contained in:
Jürg Lehni 2016-07-14 10:24:04 +02:00
parent 41dce862d4
commit c2df96c440

View file

@ -169,6 +169,30 @@ var CompoundPath = PathItem.extend(/** @lends CompoundPath# */{
this.reverse();
},
/**
* Specifies whether the compound-path is fully closed, meaning all its
* contained sub-paths are closed path.
*
* @bean
* @type Boolean
* @see Path#isClosed()
*/
isClosed: function() {
var children = this._children;
for (var i = 0, l = children.length; i < l; i++) {
if (!children[i]._closed)
return false;
}
return true;
},
setClosed: function(closed) {
var children = this._children;
for (var i = 0, l = children.length; i < l; i++) {
children[i].setClosed(closed);
}
},
/**
* The first Segment contained within the compound-path, a short-cut to
* calling {@link Path#getFirstSegment()} on {@link Item#getFirstChild()}.