summaryrefslogtreecommitdiff
path: root/src/cairo-traps.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-09-24 11:34:27 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2008-09-24 11:45:40 +0100
commit911d5f1a254f800fe18f4554b738006aa0a693a2 (patch)
treeae4a2a48fc779e54829a51b733815cbf412376c8 /src/cairo-traps.c
parent7357e80054b80a9906783ed910282bb79f31cdfd (diff)
downloadcairo-911d5f1a254f800fe18f4554b738006aa0a693a2.tar.gz
[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.
Diffstat (limited to 'src/cairo-traps.c')
-rw-r--r--src/cairo-traps.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cairo-traps.c b/src/cairo-traps.c
index c7dc94762..40bc21487 100644
--- a/src/cairo-traps.c
+++ b/src/cairo-traps.c
@@ -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;