Skip to content

Commit

Permalink
done when e = 0
Browse files Browse the repository at this point in the history
  • Loading branch information
fogleman committed Aug 30, 2019
1 parent c19d85f commit 5031b48
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/triangulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ void Triangulator::Run(

// helper function to check if triangulation is complete
const auto done = [this, maxError, maxTriangles, maxPoints]() {
if (Error() <= maxError) {
const float e = Error();
if (e <= maxError) {
return true;
}
if (maxTriangles > 0 && NumTriangles() >= maxTriangles) {
Expand All @@ -36,7 +37,7 @@ void Triangulator::Run(
if (maxPoints > 0 && NumPoints() >= maxPoints) {
return true;
}
return false;
return e == 0;
};

while (!done()) {
Expand Down

0 comments on commit 5031b48

Please sign in to comment.