1 diff --git a/src/cairo.c b/src/cairo.c
2 index 5f26d6f..c462e42 100644
5 @@ -530,6 +530,11 @@ cairo_push_group_with_content (cairo_t *cr, cairo_content_t content)
6 parent_surface->device_transform.x0 - extents.x,
7 parent_surface->device_transform.y0 - extents.y);
9 + /* If we have a current path, we need to adjust it to compensate for
10 + * the device offset just applied. */
11 + _cairo_path_fixed_transform (cr->path,
12 + &group_surface->device_transform);
14 /* create a new gstate for the redirect */
17 @@ -613,6 +618,11 @@ cairo_pop_group (cairo_t *cr)
18 cairo_pattern_set_matrix (group_pattern, &group_matrix);
21 + /* If we have a current path, we need to adjust it to compensate for
22 + * the device offset just removed. */
23 + _cairo_path_fixed_transform (cr->path,
24 + &group_surface->device_transform_inverse);
27 cairo_surface_destroy (group_surface);