Skip to content

Commit

Permalink
slightly saner fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mourner committed Sep 17, 2019
1 parent 7d0a2ff commit aa6f300
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/earcut.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ function findHoleBridge(hole, outerNode) {
var stop = m,
mx = m.x,
my = m.y,
tanMin = Infinity,
tanMin = Math.abs(hy - my) / (hx - mx),
tan;

p = m.next;
Expand All @@ -344,8 +344,8 @@ function findHoleBridge(hole, outerNode) {

tan = Math.abs(hy - p.y) / (hx - p.x); // tangential

if ((tan < tanMin || (tan === tanMin && p.x > m.x)) && locallyInside(p, hole) &&
(!equals(m, p) || area(m, m.next, p.next) > 0)) {
if ((tan < tanMin || (tan === tanMin && (p.x > m.x || area(m, m.next, p.next) > 0))) &&
locallyInside(p, hole)) {
m = p;
tanMin = tan;
}
Expand Down

0 comments on commit aa6f300

Please sign in to comment.