[gtk+/wip/otte/gadget: 4/8] rendericon: Restore cairo matrix after rendering



commit 5a37446db5eb1d07c8b07b81af9167252a5ae964
Author: Benjamin Otte <otte redhat com>
Date:   Mon Dec 14 02:33:21 2015 +0100

    rendericon: Restore cairo matrix after rendering

 gtk/gtkrendericon.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkrendericon.c b/gtk/gtkrendericon.c
index a6aecbc..081b660 100644
--- a/gtk/gtkrendericon.c
+++ b/gtk/gtkrendericon.c
@@ -96,7 +96,7 @@ gtk_css_style_render_icon_surface (GtkCssStyle            *style,
                                    double                  y)
 {
   const GtkCssValue *shadows;
-  cairo_matrix_t matrix, transform_matrix;
+  cairo_matrix_t matrix, transform_matrix, saved_matrix;
   GdkRectangle extents;
 
   g_return_if_fail (GTK_IS_CSS_STYLE (style));
@@ -114,6 +114,7 @@ gtk_css_style_render_icon_surface (GtkCssStyle            *style,
       return;
     }
 
+  cairo_get_matrix (cr, &saved_matrix);
   cairo_translate (cr, x + extents.x, y + extents.y);
 
   if (_gtk_css_transform_value_get_matrix (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_ICON_TRANSFORM), 
&transform_matrix))
@@ -138,5 +139,7 @@ gtk_css_style_render_icon_surface (GtkCssStyle            *style,
       _gtk_css_shadows_value_paint_icon (shadows, cr);
       cairo_paint (cr);
     }
+
+  cairo_set_matrix (cr, &saved_matrix);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]