mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 16:58:01 +02:00
Center the group pattern transform around the device_transformed origin
When popping a group, transform it by the ctm centered at the origin
specified by the device_transform so that it ends up in the right place
when we try to paint. This fixes the regressions caused by
1a9809baab as shown by the pdf backend.
This commit is contained in:
parent
e8ddbd1a14
commit
16939e1a86
1 changed files with 11 additions and 1 deletions
12
src/cairo.c
12
src/cairo.c
|
|
@ -587,7 +587,17 @@ cairo_pop_group (cairo_t *cr)
|
|||
}
|
||||
|
||||
_cairo_gstate_get_matrix (cr->gstate, &group_matrix);
|
||||
cairo_pattern_set_matrix (group_pattern, &group_matrix);
|
||||
/* Transform by group_matrix centered around device_transform so that when
|
||||
* we call _cairo_gstate_copy_transformed_pattern the result is a pattern
|
||||
* with a matrix equivalent to the device_transform of group_surface. */
|
||||
if (_cairo_surface_has_device_transform (group_surface)) {
|
||||
cairo_pattern_set_matrix (group_pattern, &group_surface->device_transform);
|
||||
_cairo_pattern_transform (group_pattern, &group_matrix);
|
||||
_cairo_pattern_transform (group_pattern, &group_surface->device_transform_inverse);
|
||||
} else {
|
||||
cairo_pattern_set_matrix (group_pattern, &group_matrix);
|
||||
}
|
||||
|
||||
done:
|
||||
cairo_surface_destroy (group_surface);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue