diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c index 4d713e6c6..96784a0b6 100644 --- a/src/cairo-pattern.c +++ b/src/cairo-pattern.c @@ -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 */ diff --git a/test/reference/record1414x-paint-alpha-clip-mask.pdf.argb32.ref.png b/test/reference/record1414x-paint-alpha-clip-mask.pdf.argb32.ref.png index 5bb4bbd1c..4b83e051f 100644 Binary files a/test/reference/record1414x-paint-alpha-clip-mask.pdf.argb32.ref.png and b/test/reference/record1414x-paint-alpha-clip-mask.pdf.argb32.ref.png differ diff --git a/test/reference/record1414x-paint-alpha-clip-mask.quartz.ref.png b/test/reference/record1414x-paint-alpha-clip-mask.quartz.ref.png index 5bb4bbd1c..4b83e051f 100644 Binary files a/test/reference/record1414x-paint-alpha-clip-mask.quartz.ref.png and b/test/reference/record1414x-paint-alpha-clip-mask.quartz.ref.png differ diff --git a/test/reference/record1414x-paint-alpha-clip-mask.ref.png b/test/reference/record1414x-paint-alpha-clip-mask.ref.png index 78442bdbc..fce5f6be0 100644 Binary files a/test/reference/record1414x-paint-alpha-clip-mask.ref.png and b/test/reference/record1414x-paint-alpha-clip-mask.ref.png differ