# HG changeset patch # User Eric Warmenhoven # Date 968621923 0 # Node ID 7d243094a3aee7e8e2a114a3ca048bb316ad87aa # Parent 750d8c8f6aba11b47522eafe405d210b12b3b2be [gaim-migrate @ 881] backing out fflew's fix. it isn't correct. the only thing that should need to be drawn is what's prior to it. the way it is with fflew's fix, text gets overwritten with the background color. diff -r 750d8c8f6aba -r 7d243094a3ae src/gtkhtml.c --- a/src/gtkhtml.c Sun Sep 10 21:38:38 2000 +0000 +++ b/src/gtkhtml.c Sun Sep 10 21:38:43 2000 +0000 @@ -169,8 +169,6 @@ static void draw_cursor(GtkHtml * html); static void undraw_cursor(GtkHtml * html); -static int get_line_height(GtkHtml *, GtkHtmlBit *); - static GtkWidgetClass *parent_class = NULL; GtkType gtk_html_get_type(void) @@ -1824,27 +1822,21 @@ return TRUE; } + static void gtk_html_draw_bit(GtkHtml * html, GtkHtmlBit * hb, int redraw) { int mypos, epos, - spos, - max_height; + spos; GdkGC *gc = html->gc; int shift; GtkStateType selected_state; GtkWidget *widget = GTK_WIDGET(html); GdkRectangle area; - GList *hbits; - GtkHtmlBit *hbit; if (html->frozen > 0) return; - hbits = html->html_bits; - - hbits = g_list_find(hbits, hb); - if (hb->type == HTML_BIT_TEXT) { @@ -2056,19 +2048,9 @@ /*end my stuff*/ - - - if (hb->text && hb->back != NULL && selected_state != GTK_STATE_SELECTED) - { - int hwidth, hheight, hei; - if (hbits->prev) - { - hbit = hbits->prev->data; - if (hbit->newline) - hei = get_line_height(html, hb); - } - else - hei = get_line_height(html, hb); + if (hb->text && hb->back != NULL && selected_state != GTK_STATE_SELECTED) { + int hwidth, hheight; + int hei = gdk_text_height(hb->font, "C", 1); gdk_window_get_size(html->html_area, &hwidth, &hheight); gdk_gc_set_foreground(gc, hb->back); gdk_draw_rectangle(html->html_area, gc, TRUE /* filled */, @@ -2107,6 +2089,7 @@ } else if (hb->type == HTML_BIT_SEP) { + gdk_draw_line(html->html_area, gc, hb->x + 2, hb->y - html->yoffset - (hb->height / 2 - 1), hb->x + hb->width, @@ -4346,27 +4329,3 @@ } } } - -static int get_line_height(GtkHtml *html, GtkHtmlBit *start) -{ - int height, max_height = 0; - GList *hbits = html->html_bits; - GtkHtmlBit *hbit; - - hbits = g_list_find(hbits, start); - - while (TRUE) - { - hbit = hbits->data; - if (hbit->font) - height = gdk_text_height(hbit->font, "C", 1); - - if (max_height < height) - max_height = height; - if (hbit->newline) - break; - hbits = hbits->next; - } - - return max_height; -} \ No newline at end of file