text: Invalidate caches and sizes in set_text_internal()
authorEmmanuele Bassi <ebassi@linux.intel.com>
Tue, 20 Oct 2009 21:05:04 +0000 (22:05 +0100)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Tue, 20 Oct 2009 21:09:21 +0000 (22:09 +0100)
The change in commit 3bbc96e17e5a03ba931c86a5cd2a0ecaa2a3b77b moved the
:text property setter to use set_text_internal(); this function does not
invalidate the Layout cache and does not queue a relayout, thus breaking
the behaviour of ClutterText when setting the contents of the actor using
the property.

http://bugzilla.openedhand.com/show_bug.cgi?id=1851

clutter/clutter-text.c

index 92b8848..f2be3ea 100644 (file)
@@ -804,6 +804,10 @@ clutter_text_set_text_internal (ClutterText *self,
       clutter_text_set_selection_bound (self, -1);
     }
 
+  clutter_text_dirty_cache (self);
+
+  clutter_actor_queue_relayout (CLUTTER_ACTOR (self));
+
   g_signal_emit (self, text_signals[TEXT_CHANGED], 0);
   g_object_notify (G_OBJECT (self), "text");
 
@@ -3443,10 +3447,6 @@ clutter_text_set_text (ClutterText *self,
 
   clutter_text_set_use_markup_internal (self, FALSE);
   clutter_text_set_text_internal (self, text ? text : "");
-
-  clutter_text_dirty_cache (self);
-
-  clutter_actor_queue_relayout (CLUTTER_ACTOR (self));
 }
 
 /**
@@ -3479,10 +3479,6 @@ clutter_text_set_markup (ClutterText *self,
     clutter_text_set_markup_internal (self, markup);
   else
     clutter_text_set_text_internal (self, "");
-
-  clutter_text_dirty_cache (self);
-
-  clutter_actor_queue_relayout (CLUTTER_ACTOR (self));
 }
 
 /**