diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c index 5a6bf6c9c..9d476cdee 100644 --- a/src/cairo-pattern.c +++ b/src/cairo-pattern.c @@ -2000,8 +2000,11 @@ _cairo_pattern_acquire_surface_for_surface (const cairo_surface_pattern_t *pat assert (invert_status == CAIRO_STATUS_SUCCESS); if (m.x0 != 0. || m.y0 != 0.) { - x = floor (m.x0); - y = floor (m.y0); + /* pixman also limits the [xy]_offset to 16 bits so evenly + * spread the bits between the two. + */ + x = floor (m.x0 / 2); + y = floor (m.y0 / 2); attr->x_offset -= x; attr->y_offset -= y; cairo_matrix_init_translate (&m, x, y); diff --git a/test/scale-offset-image.ps.ref.png b/test/scale-offset-image.ps.ref.png index b87612aaa..1aed28d38 100644 Binary files a/test/scale-offset-image.ps.ref.png and b/test/scale-offset-image.ps.ref.png differ diff --git a/test/scale-offset-image.ref.png b/test/scale-offset-image.ref.png index 325bdf43a..8c6b0fe2c 100644 Binary files a/test/scale-offset-image.ref.png and b/test/scale-offset-image.ref.png differ diff --git a/test/scale-offset-similar.ps.ref.png b/test/scale-offset-similar.ps.ref.png index a60e9ad4d..7002b2ef9 100644 Binary files a/test/scale-offset-similar.ps.ref.png and b/test/scale-offset-similar.ps.ref.png differ diff --git a/test/scale-offset-similar.ref.png b/test/scale-offset-similar.ref.png index 325bdf43a..8c6b0fe2c 100644 Binary files a/test/scale-offset-similar.ref.png and b/test/scale-offset-similar.ref.png differ