[cairo] Offset the current path when pushing/popping groups.

We need to translate the path in order to compensate for the device offset
applied to the group surface when pushing and popping. (The path is
transformed to device space on creation, and so needs recomputing for the
new device.)
This commit is contained in:
Chris Wilson 2009-06-19 19:03:17 +01:00
parent 851c883962
commit 62dc0ae46c

View file

@ -530,6 +530,11 @@ cairo_push_group_with_content (cairo_t *cr, cairo_content_t content)
parent_surface->device_transform.x0 - extents.x,
parent_surface->device_transform.y0 - extents.y);
/* If we have a current path, we need to adjust it to compensate for
* the device offset just applied. */
_cairo_path_fixed_transform (cr->path,
&group_surface->device_transform);
/* create a new gstate for the redirect */
cairo_save (cr);
if (cr->status)
@ -613,6 +618,11 @@ cairo_pop_group (cairo_t *cr)
cairo_pattern_set_matrix (group_pattern, &group_matrix);
}
/* If we have a current path, we need to adjust it to compensate for
* the device offset just removed. */
_cairo_path_fixed_transform (cr->path,
&group_surface->device_transform_inverse);
done:
cairo_surface_destroy (group_surface);