From 583ea401c3e09fb5841d5a1c60a4a1f2fbd57a9e Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 11 Jun 2008 16:12:52 +0000 Subject: [PATCH] 2008-06-11 Emmanuele Bassi * clutter/clutter-label.c (clutter_label_allocate): Keep the layout if the size of the allocation is the same as the last allocation received by the label. --- ChangeLog | 6 ++++++ clutter/clutter-label.c | 18 ++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8532d96..2fa7be7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2008-06-11 Emmanuele Bassi + * clutter/clutter-label.c (clutter_label_allocate): Keep the + layout if the size of the allocation is the same as the last + allocation received by the label. + +2008-06-11 Emmanuele Bassi + * clutter/clutter-actor.c: Notify :x, :y, :width and :height properties using ClutterUnits, not pixels. diff --git a/clutter/clutter-label.c b/clutter/clutter-label.c index 5b3080d..9458a62 100644 --- a/clutter/clutter-label.c +++ b/clutter/clutter-label.c @@ -93,6 +93,8 @@ struct _ClutterLabelPrivate PangoAttrList *attrs; PangoAttrList *effective_attrs; PangoLayout *layout; + + ClutterUnit layout_width; }; /* @@ -287,14 +289,18 @@ clutter_label_allocate (ClutterActor *self, ClutterLabelPrivate *priv = label->priv; ClutterActorClass *parent_class; - /* the allocation was changed, so we must recreate the layout */ - if (priv->layout) + if (priv->layout_width != (box->x2 - box->x1)) { - g_object_unref (priv->layout); - priv->layout = NULL; - } + /* the allocation was changed, so we must recreate the layout */ + if (priv->layout) + { + g_object_unref (priv->layout); + priv->layout = NULL; + } - priv->layout = clutter_label_create_layout (label, box->x2 - box->x1); + priv->layout = clutter_label_create_layout (label, box->x2 - box->x1); + priv->layout_width = box->x2 - box->x1; + } parent_class = CLUTTER_ACTOR_CLASS (clutter_label_parent_class); parent_class->allocate (self, box, origin_changed); -- 2.7.4