From 63f611dc4ecef5bb0243c47d8d3caa41231019b8 Mon Sep 17 00:00:00 2001 From: Nicola Fontana Date: Tue, 13 Apr 2010 19:33:18 +0200 Subject: [PATCH] [AdgRuledFill] Do not apply local global maps twice The extents are yet in identity space, so the current transformation matrix must be reset to avoid using local and global transformations twice. Only the translation of the extents (yet in identity space) is applied. --- src/adg/adg-ruled-fill.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/adg/adg-ruled-fill.c b/src/adg/adg-ruled-fill.c index 19841a30..e85f3403 100644 --- a/src/adg/adg-ruled-fill.c +++ b/src/adg/adg-ruled-fill.c @@ -328,8 +328,11 @@ apply(AdgStyle *style, AdgEntity *entity, cairo_t *cr) cairo_pattern_destroy(pattern); } - cairo_matrix_init_translate(&matrix, -extents->org.x, -extents->org.y); - cairo_pattern_set_matrix(pattern, &matrix); + /* The extents are yet in identity space, so the ctm should be + * reset to avoid using local and global maps twice: only the + * translation (also in identity space) is applied */ + cairo_matrix_init_translate(&matrix, extents->org.x, extents->org.y); + cairo_set_matrix(cr, &matrix); if (PARENT_STYLE_CLASS->apply) PARENT_STYLE_CLASS->apply(style, entity, cr); @@ -410,8 +413,8 @@ create_pattern(AdgRuledFill *ruled_fill, AdgEntity *entity, cairo_t *cr) extents->size.x, extents->size.y); pattern = cairo_pattern_create_for_surface(surface); - /* The pattern holds a reference to the surface, so the - * surface should be unreferenced once */ + /* The pattern holds a reference to the surface, so + * there is no need to hold another reference here */ cairo_surface_destroy(surface); spacing.x = cos(data->angle) * data->spacing; -- 2.11.4.GIT