From 9d8d735221fca1a646bb9c9ba11b8a737779bf9c Mon Sep 17 00:00:00 2001 From: Youngbok Shin Date: Thu, 1 Jun 2017 14:27:55 +0900 Subject: [PATCH] edje_calc: fix calculation for vertically expandable textblock without max height If there is no maximum height in description, Then the following textblock should be vertically expandable without ellipsis. part { name: "textblock"; type: TEXTBLOCK; description { min: X X; text.min: 0 1; } } @tizen_fix Change-Id: I19239732d309c3d1b32e68201a24a9038fca8643 --- src/lib/edje/edje_calc.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index 27b21f2..6837d13 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -1737,7 +1737,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, { /* text.min: 0 1 * text.max: X X */ - int temp_h = TO_INT(params->eval.h); + int temp_h; int temp_w = TO_INT(params->eval.w); if (min_calc_w > temp_w) @@ -1746,18 +1746,22 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, maxw && (*maxw > -1) && (*maxw < temp_w)) temp_w = *maxw; - if (chosen_desc->text.max_y) + if (!chosen_desc->text.max_y && maxh && (*maxh > -1)) { /* text.min: 0 1 - * text.max: X 1 */ - temp_h = INT_MAX / 10000; + * text.max: X 0 + * And there is a limit for height. */ + temp_h = *maxh; } - else if (maxh && (*maxh > TO_INT(params->eval.h))) + else { /* text.min: 0 1 + * text.max: X 1 + * or + * text.min: 0 1 * text.max: X 0 - * And there is a limit for height. */ - temp_h = *maxh; + * And there is no a limit for height. */ + temp_h = INT_MAX / 10000; } /* If base width for calculation is 0, -- 2.7.4