minor optimizations to box recalculation.

just recalculate when required, and just mark as required when layout
really changes.



SVN revision: 39299
This commit is contained in:
Gustavo Sverzut Barbieri 2009-02-28 20:04:55 +00:00
parent 0a544a09d3
commit 071ad5b4aa
2 changed files with 8 additions and 1 deletions

View File

@ -1238,7 +1238,11 @@ _edje_box_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edje_
evas_object_box_align_set(ep->object, chosen_desc->box.align.x, chosen_desc->box.align.y);
evas_object_box_padding_set(ep->object, chosen_desc->box.padding.x, chosen_desc->box.padding.y);
evas_object_smart_calculate(ep->object);
if (evas_object_smart_need_recalculate_get(ep->object))
{
evas_object_smart_need_recalculate_set(ep->object, 0);
evas_object_smart_calculate(ep->object);
}
evas_object_size_hint_min_get(ep->object, &min_w, &min_h);
if (chosen_desc->box.min.h)
p3->w = min_w;

View File

@ -552,6 +552,9 @@ evas_object_box_layout_set(Evas_Object *o, Evas_Object_Box_Layout cb, const void
{
EVAS_OBJECT_BOX_DATA_GET_OR_RETURN(o, priv);
if ((priv->layout.cb == cb) && (priv->layout.data == data) && (priv->layout.free_data == free_data))
return;
if (priv->layout.data && priv->layout.free_data)
priv->layout.free_data(priv->layout.data);