mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 10:48:38 -05:00
Implement CompoundPath#closed.
This commit is contained in:
parent
41dce862d4
commit
c2df96c440
1 changed files with 24 additions and 0 deletions
|
@ -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()}.
|
||||
|
|
Loading…
Reference in a new issue