mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Simple code improvement in #isClockwise().
This commit is contained in:
parent
4ffcdc3971
commit
e4ba0d80b6
1 changed files with 4 additions and 2 deletions
|
@ -2227,12 +2227,14 @@ statics: {
|
|||
*/
|
||||
isClockwise: function(segments) {
|
||||
var sum = 0,
|
||||
xPre, yPre;
|
||||
xPre, yPre,
|
||||
add = false;
|
||||
function edge(x, y) {
|
||||
if (xPre !== undefined)
|
||||
if (add)
|
||||
sum += (xPre - x) * (y + yPre);
|
||||
xPre = x;
|
||||
yPre = y;
|
||||
add = true;
|
||||
}
|
||||
// Method derived from:
|
||||
// http://stackoverflow.com/questions/1165647
|
||||
|
|
Loading…
Reference in a new issue