Skip to content

Commit f74c9c5

Browse files
committed
Port fix for mapbox/earcut#29
Refs #6
1 parent 3cb78fd commit f74c9c5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/earcut.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,8 @@ Earcut<Coord, N>::getLeftmost(Node* start) {
668668
// check if a diagonal between two polygon nodes is valid (lies in polygon interior)
669669
template <typename Coord, typename N>
670670
bool Earcut<Coord, N>::isValidDiagonal(Node* a, Node* b) {
671-
return !intersectsPolygon(a, a, b) &&
671+
return a->next->i != b->i && a->prev->i != b->i &&
672+
!intersectsPolygon(a, a, b) &&
672673
locallyInside(a, b) && locallyInside(b, a) &&
673674
middleInside(a, a->v, b->v);
674675
}

0 commit comments

Comments
 (0)