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)
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
107_edje_box_layout(Evas_Object *obj, Evas_Object_Box_Data *priv, void *data) 107_edje_box_layout(Evas_Object *obj, Evas_Object_Box_Data *priv, void *data)
108{ 108{
109 Edje_Part_Box_Animation *anim = data; 109 Edje_Part_Box_Animation *anim = data;
110 if (anim->progress < 0.01) 110
111 if (anim->progress == 0.0)
111 { 112 {
112 if (anim->start.layout) 113 if (anim->start.layout)
113 { 114 {
@@ -194,7 +195,7 @@ _edje_box_recalc_apply(Edje *ed EINA_UNUSED, Edje_Real_Part *ep, Edje_Calc_Param
194 ep->typedata.container->anim->end.layout = NULL; 195 ep->typedata.container->anim->end.layout = NULL;
195 } 196 }
196 197
197 if (ep->description_pos < 0.01 || !ep->typedata.container->anim->start.layout) 198 if (ep->description_pos == 0.0 || !ep->typedata.container->anim->start.layout)
198 { 199 {
199 _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); 200 _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);
200 ep->typedata.container->anim->start.padding.x = chosen_desc->box.padding.x; 201 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,
2966} 2966}
2967 2967
2968static void 2968static void
2969_edje_table_recalc_apply(Edje *ed EINA_UNUSED,
2970 Edje_Real_Part *ep,
2971 Edje_Calc_Params *p3 EINA_UNUSED,
2972 Edje_Part_Description_Table *chosen_desc)
2973{
2974 evas_obj_table_homogeneous_set(ep->object, chosen_desc->table.homogeneous);
2975 evas_obj_table_align_set(ep->object, TO_DOUBLE(chosen_desc->table.align.x), TO_DOUBLE(chosen_desc->table.align.y));
2976 evas_obj_table_padding_set(ep->object, chosen_desc->table.padding.x, chosen_desc->table.padding.y);
2977 if (evas_object_smart_need_recalculate_get(ep->object))
2978 {
2979 efl_canvas_group_need_recalculate_set(ep->object, 0);
2980 efl_canvas_group_calculate(ep->object);
2981 }
2982}
2983
2984static void
2969_edje_part_recalc_single(Edje *ed, 2985_edje_part_recalc_single(Edje *ed,
2970 Edje_Real_Part *ep, 2986 Edje_Real_Part *ep,
2971 Edje_Part_Description_Common *desc, 2987 Edje_Part_Description_Common *desc,
@@ -3086,13 +3102,19 @@ _edje_part_recalc_single(Edje *ed,
3086 // limit size if needed 3102 // limit size if needed
3087 if (((((Edje_Part_Description_Table *)chosen_desc)->table.min.h) || 3103 if (((((Edje_Part_Description_Table *)chosen_desc)->table.min.h) ||
3088 (((Edje_Part_Description_Table *)chosen_desc)->table.min.v))) 3104 (((Edje_Part_Description_Table *)chosen_desc)->table.min.v)))
3089 _edje_part_recalc_single_table(ep, chosen_desc, &minw, &minh); 3105 {
3106 _edje_table_recalc_apply(ed, ep, params, (Edje_Part_Description_Table *)chosen_desc);
3107 _edje_part_recalc_single_table(ep, chosen_desc, &minw, &minh);
3108 }
3090 break; 3109 break;
3091 case EDJE_PART_TYPE_BOX: 3110 case EDJE_PART_TYPE_BOX:
3092 // limit size if needed 3111 // limit size if needed
3093 if ((((Edje_Part_Description_Box *)chosen_desc)->box.min.h) || 3112 if ((((Edje_Part_Description_Box *)chosen_desc)->box.min.h) ||
3094 (((Edje_Part_Description_Box *)chosen_desc)->box.min.v)) 3113 (((Edje_Part_Description_Box *)chosen_desc)->box.min.v))
3095 _edje_part_recalc_single_box(ep, chosen_desc, &minw, &minh); 3114 {
3115 _edje_box_recalc_apply(ed, ep, params, (Edje_Part_Description_Box *)chosen_desc);
3116 _edje_part_recalc_single_box(ep, chosen_desc, &minw, &minh);
3117 }
3096 break; 3118 break;
3097 case EDJE_PART_TYPE_IMAGE: 3119 case EDJE_PART_TYPE_IMAGE:
3098 _edje_part_recalc_single_image0(ed, ep, params, (Edje_Part_Description_Image *)desc, pos); 3120 _edje_part_recalc_single_image0(ed, ep, params, (Edje_Part_Description_Image *)desc, pos);
@@ -3161,22 +3183,6 @@ _edje_part_recalc_single(Edje *ed,
3161} 3183}
3162 3184
3163static void 3185static void
3164_edje_table_recalc_apply(Edje *ed EINA_UNUSED,
3165 Edje_Real_Part *ep,
3166 Edje_Calc_Params *p3 EINA_UNUSED,
3167 Edje_Part_Description_Table *chosen_desc)
3168{
3169 evas_obj_table_homogeneous_set(ep->object, chosen_desc->table.homogeneous);
3170 evas_obj_table_align_set(ep->object, TO_DOUBLE(chosen_desc->table.align.x), TO_DOUBLE(chosen_desc->table.align.y));
3171 evas_obj_table_padding_set(ep->object, chosen_desc->table.padding.x, chosen_desc->table.padding.y);
3172 if (evas_object_smart_need_recalculate_get(ep->object))
3173 {
3174 efl_canvas_group_need_recalculate_set(ep->object, 0);
3175 efl_canvas_group_calculate(ep->object);
3176 }
3177}
3178
3179static void
3180_edje_proxy_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edje_Part_Description_Proxy *chosen_desc, FLOAT_T pos) 3186_edje_proxy_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edje_Part_Description_Proxy *chosen_desc, FLOAT_T pos)
3181{ 3187{
3182 Edje_Real_Part *pp; 3188 Edje_Real_Part *pp;