mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-01-22 04:18:01 +00:00
Remember to do floating point division in pnpoly
This commit is contained in:
parent
04c56320d2
commit
62a74afbdc
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user