summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-11-16 14:22:48 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-11-16 14:22:48 +0000
commit9876a78fd37c20e96373434b5d129da48bc8bb66 (patch)
tree6fa883423ba1813138165f0f15a0433ac80b92a7
parent42e691d9b4de72755747a376655663b1079bb592 (diff)
downloadefl-9876a78fd37c20e96373434b5d129da48bc8bb66.tar.gz
edje - box - calc min size correctly at start ...
this fixes a logic hole where no chosen desc has been applied yet to a box and thus it has no start layout thus no way to calc a min size. this breaks min size calcs you do when setting up and object. this fixes that by forcing the chosen desk on a min size calc so there is one. @fix
-rw-r--r--src/lib/edje/edje_box_layout.c5
-rw-r--r--src/lib/edje/edje_calc.c42
2 files changed, 27 insertions, 20 deletions
diff --git a/src/lib/edje/edje_box_layout.c b/src/lib/edje/edje_box_layout.c
index a1c0d6048a..a3458cf281 100644
--- a/src/lib/edje/edje_box_layout.c
+++ b/src/lib/edje/edje_box_layout.c
@@ -107,7 +107,8 @@ static void
_edje_box_layout(Evas_Object *obj, Evas_Object_Box_Data *priv, void *data)
{
Edje_Part_Box_Animation *anim = data;
- if (anim->progress < 0.01)
+
+ if (anim->progress == 0.0)
{
if (anim->start.layout)
{
@@ -194,7 +195,7 @@ _edje_box_recalc_apply(Edje *ed EINA_UNUSED, Edje_Real_Part *ep, Edje_Calc_Param
ep->typedata.container->anim->end.layout = NULL;
}
- if (ep->description_pos < 0.01 || !ep->typedata.container->anim->start.layout)
+ if (ep->description_pos == 0.0 || !ep->typedata.container->anim->start.layout)
{
_edje_box_layout_find_all(chosen_desc->box.layout, chosen_desc->box.alt_layout, &ep->typedata.container->anim->start.layout, &ep->typedata.container->anim->start.data, &ep->typedata.container->anim->start.free_data);
ep->typedata.container->anim->start.padding.x = chosen_desc->box.padding.x;
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index c636abed95..5e1ce0bcae 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -2966,6 +2966,22 @@ _edje_part_recalc_single_mesh0(Edje_Calc_Params *params,
}
static void
+_edje_table_recalc_apply(Edje *ed EINA_UNUSED,
+ Edje_Real_Part *ep,
+ Edje_Calc_Params *p3 EINA_UNUSED,
+ Edje_Part_Description_Table *chosen_desc)
+{
+ evas_obj_table_homogeneous_set(ep->object, chosen_desc->table.homogeneous);
+ evas_obj_table_align_set(ep->object, TO_DOUBLE(chosen_desc->table.align.x), TO_DOUBLE(chosen_desc->table.align.y));
+ evas_obj_table_padding_set(ep->object, chosen_desc->table.padding.x, chosen_desc->table.padding.y);
+ if (evas_object_smart_need_recalculate_get(ep->object))
+ {
+ efl_canvas_group_need_recalculate_set(ep->object, 0);
+ efl_canvas_group_calculate(ep->object);
+ }
+}
+
+static void
_edje_part_recalc_single(Edje *ed,
Edje_Real_Part *ep,
Edje_Part_Description_Common *desc,
@@ -3086,13 +3102,19 @@ _edje_part_recalc_single(Edje *ed,
// limit size if needed
if (((((Edje_Part_Description_Table *)chosen_desc)->table.min.h) ||
(((Edje_Part_Description_Table *)chosen_desc)->table.min.v)))
- _edje_part_recalc_single_table(ep, chosen_desc, &minw, &minh);
+ {
+ _edje_table_recalc_apply(ed, ep, params, (Edje_Part_Description_Table *)chosen_desc);
+ _edje_part_recalc_single_table(ep, chosen_desc, &minw, &minh);
+ }
break;
case EDJE_PART_TYPE_BOX:
// limit size if needed
if ((((Edje_Part_Description_Box *)chosen_desc)->box.min.h) ||
(((Edje_Part_Description_Box *)chosen_desc)->box.min.v))
- _edje_part_recalc_single_box(ep, chosen_desc, &minw, &minh);
+ {
+ _edje_box_recalc_apply(ed, ep, params, (Edje_Part_Description_Box *)chosen_desc);
+ _edje_part_recalc_single_box(ep, chosen_desc, &minw, &minh);
+ }
break;
case EDJE_PART_TYPE_IMAGE:
_edje_part_recalc_single_image0(ed, ep, params, (Edje_Part_Description_Image *)desc, pos);
@@ -3161,22 +3183,6 @@ _edje_part_recalc_single(Edje *ed,
}
static void
-_edje_table_recalc_apply(Edje *ed EINA_UNUSED,
- Edje_Real_Part *ep,
- Edje_Calc_Params *p3 EINA_UNUSED,
- Edje_Part_Description_Table *chosen_desc)
-{
- evas_obj_table_homogeneous_set(ep->object, chosen_desc->table.homogeneous);
- evas_obj_table_align_set(ep->object, TO_DOUBLE(chosen_desc->table.align.x), TO_DOUBLE(chosen_desc->table.align.y));
- evas_obj_table_padding_set(ep->object, chosen_desc->table.padding.x, chosen_desc->table.padding.y);
- if (evas_object_smart_need_recalculate_get(ep->object))
- {
- efl_canvas_group_need_recalculate_set(ep->object, 0);
- efl_canvas_group_calculate(ep->object);
- }
-}
-
-static void
_edje_proxy_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edje_Part_Description_Proxy *chosen_desc, FLOAT_T pos)
{
Edje_Real_Part *pp;