From daeb3b2fecb3d740b6d84215928fc4477396dc71 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 30 Nov 2009 16:14:09 +0000 Subject: [PATCH] actor: Set text direction on parenting When setting the parent on an actor we should set the text direction to be the same as the parent's. --- clutter/clutter-actor.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index efbce27..d7ef7d8 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -6618,6 +6618,7 @@ clutter_actor_set_parent (ClutterActor *self, ClutterActor *parent) { ClutterActorPrivate *priv; + ClutterTextDirection text_dir; g_return_if_fail (CLUTTER_IS_ACTOR (self)); g_return_if_fail (CLUTTER_IS_ACTOR (parent)); @@ -6656,13 +6657,15 @@ clutter_actor_set_parent (ClutterActor *self, */ clutter_actor_update_map_state (self, MAP_STATE_CHECK); + /* propagate the parent's text direction to the child */ + text_dir = clutter_actor_get_text_direction (parent); + clutter_actor_set_text_direction (self, text_dir); + if (priv->show_on_set_parent) clutter_actor_show (self); if (CLUTTER_ACTOR_IS_MAPPED (self)) - { - clutter_actor_queue_redraw (self); - } + clutter_actor_queue_redraw (self); /* maintain the invariant that if an actor needs layout, * its parents do as well @@ -9461,8 +9464,9 @@ clutter_actor_get_text_direction (ClutterActor *self) priv = self->priv; + /* if no direction has been set yet use the default */ if (priv->text_direction == CLUTTER_TEXT_DIRECTION_DEFAULT) - return clutter_get_default_text_direction (); + priv->text_direction = clutter_get_default_text_direction (); return priv->text_direction; } -- 2.7.4