[cairo-commit] Branch '1.8' - src/cairo.c
Chris Wilson
ickle at kemper.freedesktop.org
Fri Jun 19 11:20:00 PDT 2009
src/cairo.c | 10 ++++++++++
1 file changed, 10 insertions(+)
New commits:
commit 77b7d6f487d80b92d4b717de7bdb05c99d37480a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Fri Jun 19 19:03:17 2009 +0100
[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.)
diff --git a/src/cairo.c b/src/cairo.c
index a2e9842..63d2693 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);
More information about the cairo-commit
mailing list