rendericon: Save and restore cairo matrix

... instead of requiring cairo_save()/cairo_restore().
This commit is contained in:
Benjamin Otte 2016-01-06 18:14:11 +01:00
parent 4e627e108e
commit 0138af9f96

View File

@ -39,7 +39,7 @@ gtk_css_style_render_icon (GtkCssStyle *style,
GtkCssImageBuiltinType builtin_type) GtkCssImageBuiltinType builtin_type)
{ {
const GtkCssValue *shadows; const GtkCssValue *shadows;
cairo_matrix_t matrix, transform_matrix; cairo_matrix_t matrix, transform_matrix, saved_matrix;
GtkCssImage *image; GtkCssImage *image;
g_return_if_fail (GTK_IS_CSS_STYLE (style)); g_return_if_fail (GTK_IS_CSS_STYLE (style));
@ -49,6 +49,8 @@ gtk_css_style_render_icon (GtkCssStyle *style,
if (image == NULL) if (image == NULL)
return; return;
cairo_get_matrix (cr, &saved_matrix);
shadows = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_ICON_SHADOW); shadows = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_ICON_SHADOW);
cairo_translate (cr, x, y); cairo_translate (cr, x, y);
@ -75,6 +77,8 @@ gtk_css_style_render_icon (GtkCssStyle *style,
cairo_paint (cr); cairo_paint (cr);
} }
} }
cairo_set_matrix (cr, &saved_matrix);
} }
gboolean gboolean