Skip to content

Commit

Permalink
Fix a race condition in pass 1 (#121)
Browse files Browse the repository at this point in the history
* fix a race condition in pass 1

* fix uglify
  • Loading branch information
mourner authored Sep 17, 2019
1 parent 0bcf062 commit 005252c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test": "eslint src test/test.js && tape test/test.js",
"watch": "mkdirp dist && watchify -v -d src/earcut.js -s earcut -o dist/earcut.dev.js",
"build-dev": "mkdirp dist && browserify -d src/earcut.js -s earcut > dist/earcut.dev.js",
"build-min": "mkdirp dist && browserify src/earcut.js -s earcut | uglifyjs -c warnings=false -m > dist/earcut.min.js",
"build-min": "mkdirp dist && browserify src/earcut.js -s earcut | uglifyjs -c -m > dist/earcut.min.js",
"prepare": "npm run build-dev && npm run build-min",
"cov": "istanbul cover test/*.js",
"coveralls": "istanbul cover test/*.js && coveralls < ./coverage/lcov.info"
Expand Down
2 changes: 1 addition & 1 deletion src/earcut.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ function cureLocalIntersections(start, triangles, dim) {
p = p.next;
} while (p !== start);

return p;
return filterPoints(p);
}

// try splitting polygon into two and triangulate them independently
Expand Down
3 changes: 2 additions & 1 deletion test/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"bad-diagonals": 7,
"issue83": 0,
"issue107": 0,
"issue111": 19
"issue111": 19,
"boxy": 56
},
"errors": {
"dude": 2e-15,
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/boxy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[[[3432,2779],[3432,2794],[3450,2794],[3450,2825],[3413,2825],[3413,2856],[3395,2856],[3395,2871],[3377,2871],[3377,2856],[3359,2856],[3359,2840],[3341,2840],[3341,2871],[3322,2871],[3322,2887],[3249,2887],[3249,2871],[3268,2871],[3268,2840],[3304,2840],[3304,2825],[3322,2825],[3322,2810],[3304,2810],[3304,2794],[3322,2794],[3322,2779],[3341,2779],[3341,2733],[3359,2733],[3359,2687],[3395,2687],[3395,2702],[3432,2702],[3432,2717],[3450,2717],[3450,2733],[3486,2733],[3486,2748],[3468,2748],[3468,2763],[3450,2763],[3450,2779],[3432,2779]],[[3359,2794],[3341,2794],[3341,2810],[3395,2810],[3395,2794],[3377,2794],[3377,2779],[3359,2779],[3359,2794]],[[3432,2779],[3432,2748],[3413,2748],[3413,2779],[3432,2779]],[[3377,2779],[3395,2779],[3395,2748],[3377,2748],[3377,2779]],[[3377,2717],[3395,2717],[3395,2702],[3377,2702],[3377,2717]]]

0 comments on commit 005252c

Please sign in to comment.