diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index e92d87d..9b1001c 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -1473,10 +1473,10 @@ _cairo_pattern_acquire_surface_for_surface (cairo_surface_pattern_t *pattern,
* want to clone more than the surface itself, (we
* know we're not repeating at this point due to the
* above. */
- x = MAX (0, floor (x1));
- y = MAX (0, floor (y1));
- width = MIN (extents.width, ceil (x2)) - x;
- height = MIN (extents.height, ceil (y2)) - y;
+ x = MAX (0, floor (x1) - 1);
+ y = MAX (0, floor (y1) - 1);
+ width = MIN (extents.width, ceil (x2) + 1) - x;
+ height = MIN (extents.height, ceil (y2) + 1) - y;
}
x += tx;
y += ty;