Skip to content

Commit

Permalink
declare i,j
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasplesch committed Feb 23, 2016
1 parent b26aae8 commit b41cd71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/earcut.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ function earcut(data, holeIndices, dim) {

// calculate original winding order of a polygon ring
function windingOrder(data, start, end, dim) {
var sum = 0;
var sum = 0, i, j;
for (i = start, j = end - dim; i < end; i += dim) {
sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);
j = i;
}
//true for clockwise
return sum > 0;
return sum > 0;
}

// create a circular doubly linked list from polygon points in the specified winding order
Expand Down

0 comments on commit b41cd71

Please sign in to comment.