Skip to content

Commit

Permalink
Port fix for mapbox/earcut#29
Browse files Browse the repository at this point in the history
Refs #6
  • Loading branch information
jfirebaugh committed Oct 13, 2015
1 parent 3cb78fd commit f74c9c5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/earcut.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,8 @@ Earcut<Coord, N>::getLeftmost(Node* start) {
// check if a diagonal between two polygon nodes is valid (lies in polygon interior)
template <typename Coord, typename N>
bool Earcut<Coord, N>::isValidDiagonal(Node* a, Node* b) {
return !intersectsPolygon(a, a, b) &&
return a->next->i != b->i && a->prev->i != b->i &&
!intersectsPolygon(a, a, b) &&
locallyInside(a, b) && locallyInside(b, a) &&
middleInside(a, a->v, b->v);
}
Expand Down

0 comments on commit f74c9c5

Please sign in to comment.