mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-04-22 12:50:45 +02:00
get-path-extents: Fix APPROX_EQUALS to round values on both sides of the comparison
This commit is contained in:
parent
602489b150
commit
e7e4a03dd3
1 changed files with 6 additions and 1 deletions
|
|
@ -78,8 +78,13 @@ check_extents (const char *message, cairo_t *cr, enum ExtentsType type,
|
|||
break;
|
||||
case APPROX_EQUALS:
|
||||
relation_string = "approx. equal";
|
||||
if (floor (ext_x1+0.5) == x && floor (ext_y1+0.5) == y && floor (ext_x2+0.5) == x + width && floor (ext_y2+0.5) == y + height)
|
||||
if (floor (ext_x1 + 0.5) == floor (x + 0.5) &&
|
||||
floor (ext_y1 + 0.5) == floor (y + 0.5) &&
|
||||
floor (ext_x2 + 0.5) == floor (x + width + 0.5) &&
|
||||
floor (ext_y2 + 0.5) == floor (y + height + 0.5))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case CONTAINS:
|
||||
relation_string = "contain";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue