diff options
author | Benjamin Otte <otte@redhat.com> | 2010-09-12 15:55:57 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-09-12 16:00:05 +0200 |
commit | 66e860b5d19ead7d30b13eacfbe65b22b24c9d37 (patch) | |
tree | f888ff55be031b2817d1d6b1b2e9dc19c9059268 | |
parent | 08dd02fe255487f5c7953de9b2c8b63c2e937989 (diff) | |
download | gtk+-66e860b5d19ead7d30b13eacfbe65b22b24c9d37.tar.gz |
style: Fix drawing of insensitive text
When writing the original code I erroneously assumed that the current
point of the cairo context would be saved by cairo_save/restore(), but
of course the current point is part of the path and therefor isn't
saved.
Also do a cairo_new_path() before rendering any text so that we are sure
the text ends up at the right spot.
-rw-r--r-- | gtk/gtkstyle.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c index d4fa6594a9..e47a01871a 100644 --- a/gtk/gtkstyle.c +++ b/gtk/gtkstyle.c @@ -4227,13 +4227,14 @@ gtk_default_draw_layout (GtkStyle *style, else cairo_translate (cr, x, y); + cairo_new_path (cr); + if (state_type == GTK_STATE_INSENSITIVE) { - cairo_save (cr); gdk_cairo_set_source_color (cr, &style->white); cairo_move_to (cr, 1, 1); _gtk_pango_fill_layout (cr, layout); - cairo_restore (cr); + cairo_new_path (cr); } gc = use_text ? &style->text[state_type] : &style->fg[state_type]; |