[traps] Adjust lines if either point is on the boundary.

If either point lies on the limit and the other outside, adjust the line
to be parallel to the boundary. This adjusts the previous test where both
points needed to be entirely outside.
This commit is contained in:
Chris Wilson 2008-09-24 11:34:27 +01:00
parent 7357e80054
commit 911d5f1a25

View file

@ -195,15 +195,15 @@ _cairo_traps_add_trap (cairo_traps_t *traps,
if (bottom > traps->limits.p2.y)
bottom = traps->limits.p2.y;
if (left->p1.x < traps->limits.p1.x &&
left->p2.x < traps->limits.p1.x)
if (left->p1.x <= traps->limits.p1.x &&
left->p2.x <= traps->limits.p1.x)
{
left->p1.x = traps->limits.p1.x;
left->p2.x = traps->limits.p1.x;
}
if (right->p1.x > traps->limits.p2.x &&
right->p2.x > traps->limits.p2.x)
if (right->p1.x >= traps->limits.p2.x &&
right->p2.x >= traps->limits.p2.x)
{
right->p1.x = traps->limits.p2.x;
right->p2.x = traps->limits.p2.x;