Remember to do floating point division in pnpoly

This commit is contained in:
Eric Fischer 2016-04-19 12:28:49 -07:00
parent 04c56320d2
commit 62a74afbdc

View File

@ -514,7 +514,7 @@ static int pnpoly(drawvec &vert, size_t start, size_t nvert, long long testx, lo
int i, j, c = 0;
for (i = 0, j = nvert - 1; i < nvert; j = i++) {
if (((vert[i + start].y > testy) != (vert[j + start].y > testy)) &&
(testx < (vert[j + start].x - vert[i + start].x) * (testy - vert[i + start].y) / (vert[j + start].y - vert[i + start].y) + vert[i + start].x))
(testx < (vert[j + start].x - vert[i + start].x) * (testy - vert[i + start].y) / (double) (vert[j + start].y - vert[i + start].y) + vert[i + start].x))
c = !c;
}
return c;