Skip to content

Commit

Permalink
fix another race condition, close #131
Browse files Browse the repository at this point in the history
  • Loading branch information
mourner committed Jan 21, 2020
1 parent 806fba6 commit a4980b8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/earcut.js
Expand Up @@ -293,6 +293,9 @@ function eliminateHole(hole, outerNode) {
outerNode = findHoleBridge(hole, outerNode);
if (outerNode) {
var b = splitPolygon(outerNode, hole);

// filter collinear points around the cuts
filterPoints(outerNode, outerNode.next);
filterPoints(b, b.next);
}
}
Expand Down
3 changes: 2 additions & 1 deletion test/expected.json
Expand Up @@ -40,7 +40,8 @@
"touching2": 8,
"touching3": 15,
"touching4": 20,
"rain": 2681
"rain": 2681,
"issue131": 12
},
"errors": {
"dude": 2e-15,
Expand Down
5 changes: 5 additions & 0 deletions test/fixtures/issue131.json
@@ -0,0 +1,5 @@
[
[[3506,-2048],[7464,402],[-2048,2685],[-2048,-2048],[3506,-2048]],
[[-2048,-37],[1235,747],[338,-1464],[-116,-1188],[-2048,-381],[-2048,-37]],
[[-1491,-1981],[-1300,-1800],[-1155,-1981],[-1491,-1981]]
]

0 comments on commit a4980b8

Please sign in to comment.