tor: Fudge the edge if it is projected into a point

If we generate an edge (through polygon-intersect) where its end-points
lie outside the line definition then it is possible for that line to be
degenerate under sample grid projection. Apply a fudge factor to prevent
explosions as otherwise we reject an edge whose height is not strictly
0.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54822
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-09-27 15:21:42 +01:00
parent cabb3c3bdf
commit 797441093a
2 changed files with 2 additions and 2 deletions

View file

@ -1506,7 +1506,7 @@ glitter_scan_converter_add_edge (glitter_scan_converter_t *converter,
INPUT_TO_GRID_Y (edge->line.p1.y, e.line.p1.y);
INPUT_TO_GRID_Y (edge->line.p2.y, e.line.p2.y);
if (e.line.p1.y == e.line.p2.y)
return;
e.line.p2.y++; /* little fudge to prevent a div-by-zero */
INPUT_TO_GRID_X (edge->line.p1.x, e.line.p1.x);
INPUT_TO_GRID_X (edge->line.p2.x, e.line.p2.x);

View file

@ -1362,7 +1362,7 @@ glitter_scan_converter_add_edge (glitter_scan_converter_t *converter,
INPUT_TO_GRID_Y (edge->line.p1.y, e.line.p1.y);
INPUT_TO_GRID_Y (edge->line.p2.y, e.line.p2.y);
if (e.line.p1.y == e.line.p2.y)
return;
e.line.p2.y++; /* Fudge to prevent div-by-zero */
INPUT_TO_GRID_X (edge->line.p1.x, e.line.p1.x);
INPUT_TO_GRID_X (edge->line.p2.x, e.line.p2.x);