Fix accidental coordinate truncation for linear intersections.

This commit is contained in:
Christopher Kohnert 2017-08-21 13:22:40 -07:00
parent b30f10ac07
commit 7959d6e984
1 changed files with 1 additions and 1 deletions

View File

@ -309,7 +309,7 @@ static int crossLine(const Point2& r, const Point2& p0, const Point2& p1, EdgeSe
if (r.x >= max(p0.x, p1.x))
return 0;
// Intersect the line at r.y and see if the intersection is before or after the origin.
int xintercept = (p0.x + (r.y - p0.y) * (p1.x - p0.x) / (p1.y - p0.y));
double xintercept = (p0.x + (r.y - p0.y) * (p1.x - p0.x) / (p1.y - p0.y));
if (r.x < xintercept) {
int w = (p0.y < p1.y) ? 1 : -1;
if( cb != NULL ) {