From d9883fee7650ff99f98ec4e4a77071ebb0161e32 Mon Sep 17 00:00:00 2001 From: Youngbok Shin Date: Tue, 17 Jan 2017 14:55:24 +0900 Subject: [PATCH] Revert "edje_calc: give +1 width from calculated width of formatted_get" This reverts commit bbf5d78d385784f2e2dfdc0830808967a919d054. There was a side effect when "text.min: 0 1" is used. Change-Id: I5edede90aabe2f9346829008f6189d7b5c038ea7 (cherry picked from commit f54f1bbf4a719fec7704137a388ce58a5a41020b) --- src/lib/edje/edje_calc.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index be7c6d6..57ef934 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -1756,8 +1756,6 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, temp_h = *maxh; } - if (temp_w > 0) temp_w--; - /* If base width for calculation is 0, * don't get meaningless height for multiline */ if (temp_w > 0) @@ -1802,7 +1800,6 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, temp_h = *maxh; } - if (temp_w > 0) temp_w--; eo_do(ep->object, efl_gfx_size_set(temp_w, temp_h), evas_obj_textblock_size_formatted_get(&tw, &th)); @@ -1843,7 +1840,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, } } - if ((tw + 1) > min_calc_w) min_calc_w = tw + 1; + if (tw > min_calc_w) min_calc_w = tw; if (th > min_calc_h) min_calc_h = th; if (chosen_desc->text.min_x && minw) *minw = min_calc_w; if (chosen_desc->text.min_y && minh) *minh = min_calc_h; @@ -1867,8 +1864,8 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, * text.max: 0 1 * Already calculated in text for height. */ tw = TO_INT(params->eval.w); - if ((min_calc_w - 1) > tw) - tw = min_calc_w - 1; + if (min_calc_w > tw) + tw = min_calc_w; th = min_calc_h; } @@ -1886,8 +1883,6 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, if (min_calc_h > temp_h) temp_h = min_calc_h; - if (temp_w > 0) temp_w--; - /* If base width for calculation is 0, * don't get meaningless height for multiline */ if (temp_w > 0) @@ -1944,7 +1939,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, /* text.min: 0 1 * text.max: 1 1 * There is no need to calculate it again. */ - tw = min_calc_w - 1; + tw = min_calc_w; th = min_calc_h; } else @@ -1952,7 +1947,6 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, /* text.min: 0 0 * text.max: 1 1 */ - if (temp_w > 0) temp_w--; eo_do(ep->object, efl_gfx_size_set(temp_w, temp_h), evas_obj_textblock_size_formatted_get(&tw, &th)); @@ -1981,7 +1975,6 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, if (min_calc_w > temp_w) temp_w = min_calc_w; - if (temp_w > 0) temp_w--; eo_do(ep->object, efl_gfx_size_get(NULL, &temp_h), efl_gfx_size_set(temp_w, temp_h), @@ -2004,12 +1997,12 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, } if (maxw && chosen_desc->text.max_x) { - if ((tw + 1) > *maxw) *maxw = tw + 1; + if (tw > *maxw) *maxw = tw; if (minw && (*maxw < *minw)) *maxw = *minw; } if (maxh && chosen_desc->text.max_y) { - if (th > *maxh) *maxh = th + 1; + if (th > *maxh) *maxh = th; if (minh && (*maxh < *minh)) *maxh = *minh; } } -- 2.7.4