diff options
author | Tom Hacohen <tom@stosb.com> | 2013-02-22 14:11:41 +0000 |
---|---|---|
committer | Tom Hacohen <tom@stosb.com> | 2013-02-22 14:11:41 +0000 |
commit | 9bc0260b51c92ac53494547285663334ee6feac6 (patch) | |
tree | 46892a42e8635e9b20868be995b2ff95b31b9504 | |
parent | 1a0ee8cb872f2af0030626bd2abd979e48f64c7c (diff) | |
download | efl-9bc0260b51c92ac53494547285663334ee6feac6.tar.gz |
Edje entry fit: Set the min/max sizes according to the fitting, not before.
-rw-r--r-- | src/lib/edje/edje_calc.c | 57 |
1 files 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)); } } |