aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-03-31 23:28:33 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-03-31 23:31:11 -0400
commit89809bdf551c4cad70eff972dff03a4a88977e0c (patch)
tree49f828208cf7832787ca45626e2e84d7a72b495a
parentedje calc no longer performs calculations for group parts of fixed size > 0 (diff)
downloadefl-89809bdf551c4cad70eff972dff03a4a88977e0c.tar.gz
edje calc now more correctly forces recalc for child groups on state change
in the event of fixed size -> non-fixed size (eg. previous commit optimization), this calc would no longer occur, so we need to queue it. also if fixed.w or fixed.h changes value for a group part, we must recalc the group to ensure correct sizing occurs
-rw-r--r--src/lib/edje/edje_calc.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index 1b74301a6d..4ef5a5a0a4 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -567,7 +567,7 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char *d1, doubl
Edje_Part_Description_Common *epd1;
Edje_Part_Description_Common *epd2 = NULL;
Edje_Part_Description_Common *chosen_desc;
-
+ Eina_Bool change_w, change_h;
Edje_Part_Description_Image *epdi;
if (!d1) d1 = "default";
@@ -627,6 +627,8 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char *d1, doubl
chosen_desc = ep->chosen_description;
ep->param1.description = epd1;
ep->chosen_description = epd1;
+ change_w = ep->chosen_description->fixed.w != chosen_desc->fixed.w;
+ change_h = ep->chosen_description->fixed.h != chosen_desc->fixed.h;
_edje_real_part_rel_to_apply(ed, ep, &ep->param1);
@@ -640,9 +642,30 @@ _edje_part_description_apply(Edje *ed, Edje_Real_Part *ep, const char *d1, doubl
ep->chosen_description = epd2;
}
- if (chosen_desc != ep->chosen_description &&
- ep->part->type == EDJE_PART_TYPE_EXTERNAL)
- _edje_external_recalc_apply(ed, ep, NULL, chosen_desc);
+ if (chosen_desc != ep->chosen_description)
+ {
+ if (ep->part->type == EDJE_PART_TYPE_EXTERNAL)
+ _edje_external_recalc_apply(ed, ep, NULL, chosen_desc);
+ else if (ep->part->type == EDJE_PART_TYPE_GROUP)
+ {
+ Edje_Size *min, *max, *pmin, *pmax;
+
+ min = &ep->chosen_description->min;
+ max = &ep->chosen_description->max;
+ pmin = &chosen_desc->min;
+ pmax = &chosen_desc->max;
+ if (change_w || change_h ||
+ (((pmin->w == pmax->w) && (pmin->h == pmax->h) && (pmin->w > 0) && (pmin->h > 0)) &&
+ (((min->w != max->w) || (min->h != max->h) || (min->w <= 0) || (min->h <= 0)))))
+ {
+ Edje *ted;
+
+ ted = _edje_fetch(ep->typedata.swallow->swallowed_object);
+ ted->recalc_call = ted->dirty = ted->recalc_hints = EINA_TRUE;
+ _edje_recalc(ted);
+ }
+ }
+ }
ed->recalc_hints = EINA_TRUE;
ed->dirty = EINA_TRUE;