Merge branch 'master' into 'master'

Fix image overclipping in vector backends

Closes #480

See merge request cairo/cairo!268
This commit is contained in:
PBS 2026-02-19 16:58:14 +09:00
commit 934b82c594
4 changed files with 12 additions and 0 deletions

View file

@ -3702,7 +3702,11 @@ _cairo_pattern_get_extents (const cairo_pattern_t *pattern,
y1 = raster->extents.y;
x2 = raster->extents.x + (int) raster->extents.width;
y2 = raster->extents.y + (int) raster->extents.height;
goto HANDLE_FILTER;
}
break;
HANDLE_FILTER:
switch (pattern->filter) {
case CAIRO_FILTER_NEAREST:
@ -3713,6 +3717,14 @@ _cairo_pattern_get_extents (const cairo_pattern_t *pattern,
y1 -= 0.004;
x2 += 0.004;
y2 += 0.004;
/* Fix clipping issue in vector backends. */
if (is_vector)
{
x1 -= 0.5;
y1 -= 0.5;
x2 += 0.5;
y2 += 0.5;
}
break;
case CAIRO_FILTER_BEST:
/* Assume best filter will produce nice antialiased edges */

Binary file not shown.

Before

Width:  |  Height:  |  Size: 522 B

After

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 522 B

After

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 566 B

After

Width:  |  Height:  |  Size: 496 B