[gtk/wip/otte/paintable] TextLayout: Clarify implementation of special case



commit 96a5141c385591ddf4781a31d01f355a34fa3839
Author: Daniel Boles <dboles src gnome org>
Date:   Wed Mar 1 20:10:55 2017 +0000

    TextLayout: Clarify implementation of special case
    
    This exists to exit early for invisible lines. It attempts to use the
    LineDisplay’s direction to create a corresponding PangoLayout. However,
    the dir is not yet set by this point, & the display was new0()d, so its
    dir is always 0 == TEXT_DIR_NONE. Thus, we always create an LTR layout.
    
    Whatever the original intent, this outcome seems to be OK, so let’s make
    the code say what it means, rather than using a misleading conditional.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=779099

 gtk/gtktextlayout.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
---
diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c
index 1d96d5f7d8..51ac51a3b6 100644
--- a/gtk/gtktextlayout.c
+++ b/gtk/gtktextlayout.c
@@ -2299,11 +2299,7 @@ gtk_text_layout_get_line_display (GtkTextLayout *layout,
    */
   if (totally_invisible_line (layout, line, &iter))
     {
-      if (display->direction == GTK_TEXT_DIR_RTL)
-       display->layout = pango_layout_new (layout->rtl_context);
-      else
-       display->layout = pango_layout_new (layout->ltr_context);
-      
+      display->layout = pango_layout_new (layout->ltr_context);
       return display;
     }
 


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