mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 08:30:42 -05:00
2008-06-11 Emmanuele Bassi <ebassi@openedhand.com>
* 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.
This commit is contained in:
parent
c859a2f7fd
commit
583ea401c3
@ -1,3 +1,9 @@
|
||||
2008-06-11 Emmanuele Bassi <ebassi@openedhand.com>
|
||||
|
||||
* 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 <ebassi@openedhand.com>
|
||||
|
||||
* clutter/clutter-actor.c: Notify :x, :y, :width and :height
|
||||
|
@ -93,6 +93,8 @@ struct _ClutterLabelPrivate
|
||||
PangoAttrList *attrs;
|
||||
PangoAttrList *effective_attrs;
|
||||
PangoLayout *layout;
|
||||
|
||||
ClutterUnit layout_width;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -287,6 +289,8 @@ clutter_label_allocate (ClutterActor *self,
|
||||
ClutterLabelPrivate *priv = label->priv;
|
||||
ClutterActorClass *parent_class;
|
||||
|
||||
if (priv->layout_width != (box->x2 - box->x1))
|
||||
{
|
||||
/* the allocation was changed, so we must recreate the layout */
|
||||
if (priv->layout)
|
||||
{
|
||||
@ -295,6 +299,8 @@ clutter_label_allocate (ClutterActor *self,
|
||||
}
|
||||
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user