edje_calc: fix calculation for vertically expandable textblock without max height 90/132090/3
authorYoungbok Shin <youngb.shin@samsung.com>
Thu, 1 Jun 2017 05:27:55 +0000 (14:27 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Fri, 9 Jun 2017 02:09:36 +0000 (02:09 +0000)
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

index 27b21f2..6837d13 100644 (file)
@@ -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,