From 9bc0260b51c92ac53494547285663334ee6feac6 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Fri, 22 Feb 2013 14:11:41 +0000 Subject: [PATCH] Edje entry fit: Set the min/max sizes according to the fitting, not before. --- src/lib/edje/edje_calc.c | 57 ++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index 5b1bf1d5d2..abda370eff 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -1269,34 +1269,6 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, } } } - if ((chosen_desc->text.max_x) || (chosen_desc->text.max_y)) - { - int mw = 0, mh = 0; - - tw = th = 0; - if (!chosen_desc->text.max_x) - { - eo_do(ep->object, - evas_obj_size_set(params->w, params->h), - evas_obj_textblock_size_formatted_get(&tw, &th)); - } - else - evas_object_textblock_size_native_get(ep->object, &tw, &th); - evas_object_textblock_style_insets_get(ep->object, &ins_l, &ins_r, - &ins_t, &ins_b); - mw = ins_l + tw + ins_r; - mh = ins_t + th + ins_b; - if (maxw && chosen_desc->text.max_x) - { - if (mw > *maxw) *maxw = mw; - if (minw && (*maxw < *minw)) *maxw = *minw; - } - if (maxh && chosen_desc->text.max_y) - { - if (mh > *maxh) *maxh = mh; - if (minh && (*maxh < *minh)) *maxh = *minh; - } - } if ((chosen_desc->text.fit_x) || (chosen_desc->text.fit_y)) { @@ -1376,6 +1348,35 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, } + if ((chosen_desc->text.max_x) || (chosen_desc->text.max_y)) + { + int mw = 0, mh = 0; + + tw = th = 0; + if (!chosen_desc->text.max_x) + { + eo_do(ep->object, + evas_obj_size_set(params->w, params->h), + evas_obj_textblock_size_formatted_get(&tw, &th)); + } + else + evas_object_textblock_size_native_get(ep->object, &tw, &th); + evas_object_textblock_style_insets_get(ep->object, &ins_l, &ins_r, + &ins_t, &ins_b); + mw = ins_l + tw + ins_r; + mh = ins_t + th + ins_b; + if (maxw && chosen_desc->text.max_x) + { + if (mw > *maxw) *maxw = mw; + if (minw && (*maxw < *minw)) *maxw = *minw; + } + if (maxh && chosen_desc->text.max_y) + { + if (mh > *maxh) *maxh = mh; + if (minh && (*maxh < *minh)) *maxh = *minh; + } + } + evas_object_textblock_valign_set(ep->object, TO_DOUBLE(chosen_desc->text.align.y)); } }