Skip to content

Commit

Permalink
Fix Polygon unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
casperlamboo committed Jan 11, 2024
1 parent 0f93601 commit c2deb49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/polygon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void Polygons::makeConvex()
if (LinearAlg2D::pointIsLeftOfLine(current, convexified.path->back(), after) < 0)
{
// Track backwards to make sure we haven't been in a concave pocket for multiple vertices already.
while (convexified.size() >= 2 && LinearAlg2D::pointIsLeftOfLine(convexified.path->back(), (*convexified.path)[convexified.size() - 2], current) > 0)
while (convexified.size() >= 2 && (LinearAlg2D::pointIsLeftOfLine(convexified.path->back(), (*convexified.path)[convexified.size() - 2], current) >= 0 || LinearAlg2D::pointIsLeftOfLine(convexified.path->back(), (*convexified.path)[convexified.size() - 2], convexified.path->front()) > 0))
{
convexified.path->pop_back();
}
Expand Down

0 comments on commit c2deb49

Please sign in to comment.