[gtk+] Fixed textview rendering regression.



commit 604292a404edd747374e43e1f7af29ac5e559e1e
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Mon Feb 14 14:00:15 2011 +0900

    Fixed textview rendering regression.
    
    Background color was not painted on the whole tagged segment after
    line breaking, this was due to the default ->prepare_run() function
    wiping the internal PangoColors clean... fixed this by unconditionally
    setting local rgba colors from prepare_run instead of comparing them
    and bailing out.

 gtk/gtktextdisplay.c |   16 ++--------------
 1 files changed, 2 insertions(+), 14 deletions(-)
---
diff --git a/gtk/gtktextdisplay.c b/gtk/gtktextdisplay.c
index e3ec766..66142f8 100644
--- a/gtk/gtktextdisplay.c
+++ b/gtk/gtktextdisplay.c
@@ -132,27 +132,15 @@ text_renderer_set_rgba (GtkTextRenderer *text_renderer,
   PangoRenderer *renderer = PANGO_RENDERER (text_renderer);
   PangoColor     dummy = { 0, };
 
-  if ((!rgba && !text_renderer->rgba_set[part]) ||
-      (rgba && text_renderer->rgba_set[part] &&
-       text_renderer->rgba[part].red == rgba->red &&
-       text_renderer->rgba[part].green == rgba->green &&
-       text_renderer->rgba[part].blue == rgba->blue &&
-       text_renderer->rgba[part].alpha == rgba->alpha))
-    return;
-
   if (rgba)
     {
-      text_renderer->rgba_set[part] = TRUE;
       text_renderer->rgba[part] = *rgba;
-
       pango_renderer_set_color (renderer, part, &dummy);
     }
   else
-    {
-      text_renderer->rgba_set[part] = FALSE;
+    pango_renderer_set_color (renderer, part, NULL);
 
-      pango_renderer_set_color (renderer, part, NULL);
-    }
+  text_renderer->rgba_set[part] = (rgba != NULL);
 }
 
 static GtkTextAppearance *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]