summaryrefslogtreecommitdiff
path: root/src/lib/edje/edje_calc.c
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 /src/lib/edje/edje_calc.c
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
Diffstat (limited to '')
-rw-r--r--src/lib/edje/edje_calc.c42
1 files changed, 24 insertions, 18 deletions
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;