summaryrefslogtreecommitdiff
path: root/gtk/gtktextdisplay.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2000-11-14 01:08:28 +0000
committerHavoc Pennington <hp@src.gnome.org>2000-11-14 01:08:28 +0000
commit73a00eeb447d40a6ed53ac57c482e4d1cb9483f3 (patch)
tree2b047070821790df0a34f712590ece91a64a14b3 /gtk/gtktextdisplay.c
parentf15049bd0241241c6865d9405a331ef1694ace56 (diff)
downloadgdk-pixbuf-73a00eeb447d40a6ed53ac57c482e4d1cb9483f3.tar.gz
fix bug where GC didn't always get updated properly
2000-11-13 Havoc Pennington <hp@redhat.com> * gtk/gtktextdisplay.c (gtk_text_render_state_update): fix bug where GC didn't always get updated properly * demos/gtk-demo/textview.c (create_tags): Use subattributes of fonts instead of setting the entire font * gtk/testtext.c (fill_example_buffer): Use "size" instead of setting entire font * gtk/gtkdialog.c (gtk_dialog_add_button): Fix some warnings * gtk/gtktexttag.h, gtk/gtktexttag.c: Explode font_desc into a bunch of individually-settable font attributes. You can still use the "font" and "font_desc" args, they just set all the font attributes at once.
Diffstat (limited to 'gtk/gtktextdisplay.c')
-rw-r--r--gtk/gtktextdisplay.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gtk/gtktextdisplay.c b/gtk/gtktextdisplay.c
index 5e42b6439..bc9ba1823 100644
--- a/gtk/gtktextdisplay.c
+++ b/gtk/gtktextdisplay.c
@@ -86,6 +86,7 @@ struct _GtkTextRenderState
GtkWidget *widget;
GtkTextAppearance *last_appearance;
+ GtkTextAppearance *last_bg_appearance;
GdkGC *fg_gc;
GdkGC *bg_gc;
GdkRectangle clip_rect;
@@ -159,12 +160,12 @@ gtk_text_render_state_update (GtkTextRenderState *state,
if (new_appearance->draw_bg)
{
- if (!state->last_appearance ||
- !gdk_color_equal (&new_appearance->bg_color, &state->last_appearance->bg_color))
+ if (!state->last_bg_appearance ||
+ !gdk_color_equal (&new_appearance->bg_color, &state->last_bg_appearance->bg_color))
gtk_text_render_state_set_color (state, state->bg_gc, &new_appearance->bg_color);
- if (!state->last_appearance ||
- new_appearance->bg_stipple != state->last_appearance->bg_stipple)
+ if (!state->last_bg_appearance ||
+ new_appearance->bg_stipple != state->last_bg_appearance->bg_stipple)
{
if (new_appearance->bg_stipple)
{
@@ -176,6 +177,8 @@ gtk_text_render_state_update (GtkTextRenderState *state,
gdk_gc_set_fill (state->bg_gc, GDK_SOLID);
}
}
+
+ state->last_bg_appearance = new_appearance;
}
state->last_appearance = new_appearance;
@@ -665,7 +668,7 @@ gtk_text_layout_draw (GtkTextLayout *layout,
GtkTextLine *line = tmp_list->data;
line_display = gtk_text_layout_get_line_display (layout, line, FALSE);
-
+
if (have_selection)
{
GtkTextIter line_start, line_end;