mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Improve documentation of PathItem#getArea() and PathItem#isClockwise()
This commit is contained in:
parent
a0417040f8
commit
baf58fb021
2 changed files with 11 additions and 4 deletions
|
@ -240,8 +240,10 @@ var CompoundPath = PathItem.extend(/** @lends CompoundPath# */{
|
|||
},
|
||||
|
||||
/**
|
||||
* The area that the path's geometry is covering. Self-intersecting paths
|
||||
* can contain sub-areas that cancel each other out.
|
||||
* The area that the compound-path's geometry is covering, calculated by
|
||||
* getting th e{@link Path#getArea()} of each sub-path and it adding up.
|
||||
* Note that self-intersecting paths and sub-paths of different orientation
|
||||
* can result in areas that cancel each other out.
|
||||
*
|
||||
* @bean
|
||||
* @type Number
|
||||
|
@ -256,7 +258,7 @@ var CompoundPath = PathItem.extend(/** @lends CompoundPath# */{
|
|||
|
||||
/**
|
||||
* The total length of all sub-paths in this compound-path, calculated by
|
||||
* getting {@link Path#getLength()} of each sub-path and it adding up.
|
||||
* getting the {@link Path#getLength()} of each sub-path and it adding up.
|
||||
*
|
||||
* @bean
|
||||
* @type Number
|
||||
|
|
|
@ -91,10 +91,15 @@ var PathItem = Item.extend(/** @lends PathItem# */{
|
|||
},
|
||||
|
||||
/**
|
||||
* Specifies whether the path is oriented clock-wise.
|
||||
* Specifies whether the path as a whole is oriented clock-wise, by looking
|
||||
* at the path's area.
|
||||
* Note that self-intersecting paths and sub-paths of different orientation
|
||||
* can result in areas that cancel each other out.
|
||||
*
|
||||
* @bean
|
||||
* @type Boolean
|
||||
* @see Path#getArea()
|
||||
* @see CompoundPath#getArea()
|
||||
*/
|
||||
isClockwise: function() {
|
||||
return this.getArea() >= 0;
|
||||
|
|
Loading…
Reference in a new issue