[gtk+] entry: avoid a mismatched cairo_save/restore
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] entry: avoid a mismatched cairo_save/restore
- Date: Mon, 5 Dec 2011 00:58:54 +0000 (UTC)
commit 2bf765ab4945daf2c97e25b9f15879860931e64e
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Sun Dec 4 19:57:25 2011 -0500
entry: avoid a mismatched cairo_save/restore
Leftover from GtkIconHelper migration.
gtk/gtkentry.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 9c41e0e..436a868 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -3374,14 +3374,9 @@ draw_icon (GtkWidget *widget,
gint x, y, width, height, pix_width, pix_height;
GtkStyleContext *context;
- context = gtk_widget_get_style_context (widget);
-
if (!icon_info)
return;
- cairo_save (cr);
- gtk_cairo_transform_to_window (cr, widget, icon_info->window);
-
width = gdk_window_get_width (icon_info->window);
height = gdk_window_get_height (icon_info->window);
@@ -3390,6 +3385,10 @@ draw_icon (GtkWidget *widget,
if (width == 1 || height == 1)
return;
+ cairo_save (cr);
+ gtk_cairo_transform_to_window (cr, widget, icon_info->window);
+
+ context = gtk_widget_get_style_context (widget);
gtk_entry_prepare_context_for_icon (entry, context, icon_pos);
_gtk_icon_helper_get_size (icon_info->icon_helper, context, &pix_width, &pix_height);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]