mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 19:18:12 +02:00
[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.
This commit is contained in:
parent
0baf12f450
commit
651c6598c9
1 changed files with 14 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue