diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2008-09-24 00:49:03 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2008-09-24 01:02:48 +0100 |
commit | 651c6598c98118ba04bc4970557c24241b91dab0 (patch) | |
tree | 22a1280aaff162618a93ce1fab89e820bf9fdfd7 /src/cairo-traps.c | |
parent | 0baf12f450e12b9f2fb4e55bfeb7738dd5145cbd (diff) | |
download | cairo-651c6598c98118ba04bc4970557c24241b91dab0.tar.gz |
[traps] Limit extents to imposed constraints.
When reporting the extents of the traps, constrain them to the imposed
limits. This is relied upon in the analysis-surface which sets the
limits on the traps (based on clip/surface extents) and then reports the
extents of the traps as the region of the operation.
Diffstat (limited to 'src/cairo-traps.c')
-rw-r--r-- | src/cairo-traps.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/cairo-traps.c b/src/cairo-traps.c index 126701521..c7dc94762 100644 --- a/src/cairo-traps.c +++ b/src/cairo-traps.c @@ -562,8 +562,21 @@ _cairo_traps_extents (const cairo_traps_t *traps, if (traps->num_traps == 0) { extents->p1.x = extents->p1.y = _cairo_fixed_from_int (0); extents->p2.x = extents->p2.y = _cairo_fixed_from_int (0); - } else + } else { *extents = traps->extents; + if (traps->has_limits) { + /* clip the traps to the imposed limits */ + if (extents->p1.x < traps->limits.p1.x) + extents->p1.x = traps->limits.p1.x; + if (extents->p2.x > traps->limits.p2.x) + extents->p2.x = traps->limits.p2.x; + + if (extents->p1.y < traps->limits.p1.y) + extents->p1.y = traps->limits.p1.y; + if (extents->p2.y > traps->limits.p2.y) + extents->p2.y = traps->limits.p2.y; + } + } } /** |