summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-06-19 19:03:17 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-06-19 19:19:51 +0100
commit77b7d6f487d80b92d4b717de7bdb05c99d37480a (patch)
tree6be409dc32cb750ed29b36aeb8ef5f3836886b29
parent158ab5cdede04de5071599a962ae9a354c223036 (diff)
downloadcairo-77b7d6f487d80b92d4b717de7bdb05c99d37480a.tar.gz
[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.)
-rw-r--r--src/cairo.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/cairo.c b/src/cairo.c
index a2e984256..63d269336 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -471,6 +471,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)
@@ -554,6 +559,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);