From 6f3fcb26948bdc608704bfaa1333137857f7eb4c Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 7 Sep 2018 17:28:55 +0200 Subject: [PATCH] fixed a bug with centerin --- polygons.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/polygons.cpp b/polygons.cpp index 2bd4af42..85356a74 100644 --- a/polygons.cpp +++ b/polygons.cpp @@ -1506,14 +1506,14 @@ void finishshape() { if(s == 3) last->intester = hpxy(.2, .2518); - last->flags &=~ POLY_BADCENTERIN; + last->flags &=~ (POLY_BADCENTERIN | POLY_CENTERIN); for(int i=last->s; ie-1; i++) { ld x1 = hpc[i][0] - last->intester[0], y1 = hpc[i][1] - last->intester[1], x2 = hpc[i+1][0] - last->intester[0], y2 = hpc[i+1][1] - last->intester[1]; if(asign(y1, y2)) { ld x = xcross(x1, y1, x2, y2); if(abs(x) < 1e-3 && !(last->flags & POLY_ISSIDE)) { - printf("close call [%d], x = %lf\n", s, x); + if(s >= 2) printf("close call [%d], x = %lf\n", s, x); last->flags |= POLY_BADCENTERIN; } if(x < 0) last->flags ^= POLY_CENTERIN;