mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 12:18:01 +02:00
[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:
parent
851c883962
commit
62dc0ae46c
1 changed files with 10 additions and 0 deletions
10
src/cairo.c
10
src/cairo.c
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue