[clutter/clutter-1.18] text: Use the resolved text direction



commit 6faf6dfe420c57f97d4603979693e282082e9a9a
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Mar 3 19:16:00 2014 +0000

    text: Use the resolved text direction
    
    Now that we compute the effective text direction when creating the Pango
    layout, we should also use it when painting it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=705779

 clutter/clutter-text.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/clutter/clutter-text.c b/clutter/clutter-text.c
index 17f3500..66fff83 100644
--- a/clutter/clutter-text.c
+++ b/clutter/clutter-text.c
@@ -200,6 +200,7 @@ struct _ClutterTextPrivate
   guint paint_volume_valid      : 1;
   guint show_password_hint      : 1;
   guint password_hint_visible   : 1;
+  guint resolved_direction      : 4;
 };
 
 enum
@@ -550,6 +551,8 @@ clutter_text_create_layout_no_cache (ClutterText       *text,
 
       pango_context_set_base_dir (clutter_actor_get_pango_context (CLUTTER_ACTOR (text)), pango_dir);
 
+      priv->resolved_direction = pango_dir;
+
       pango_layout_set_text (layout, contents, contents_len);
     }
 
@@ -2334,7 +2337,7 @@ clutter_text_paint (ClutterActor *self)
       actor_width = alloc_width - 2 * TEXT_PADDING;
       text_width  = logical_rect.width / PANGO_SCALE;
 
-      rtl = clutter_actor_get_text_direction (self) == CLUTTER_TEXT_DIRECTION_RTL;
+      rtl = priv->resolved_direction == PANGO_DIRECTION_RTL;
 
       if (actor_width < text_width)
         {


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