From 2e8571d95ca36f8ad9e20796990cdc0b3f763082 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 25 Jun 2010 13:41:22 +0200 Subject: [PATCH] push-group: Fix path translation when pushing a group with device offsets With the previous code, the parent's device offset wasn't undone before applying the new device offset. Tested by push-group-path-offset test. --- src/cairo.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cairo.c b/src/cairo.c index 9d28aeeb3..d43c03181 100644 --- a/src/cairo.c +++ b/src/cairo.c @@ -615,6 +615,7 @@ cairo_push_group_with_content (cairo_t *cr, cairo_content_t content) cairo_surface_t *parent_surface; const cairo_rectangle_int_t *clip_extents; cairo_rectangle_int_t extents; + cairo_matrix_t matrix; cairo_bool_t is_empty; parent_surface = _cairo_gstate_get_target (cr->gstate); @@ -646,8 +647,8 @@ cairo_push_group_with_content (cairo_t *cr, cairo_content_t content) /* 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); + cairo_matrix_init_translate (&matrix, -extents.x, -extents.y); + _cairo_path_fixed_transform (cr->path, &matrix); } /* create a new gstate for the redirect */