mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-31 14:50:13 +01:00
[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:
parent
7357e80054
commit
911d5f1a25
1 changed files with 4 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue