Revert "edje_calc: round the scaled value when it is casted to int type."
authorJiyoun Park <jy0703.park@samsung.com>
Mon, 5 Dec 2016 08:21:22 +0000 (17:21 +0900)
committerWonki Kim <wonki_.kim@samsung.com>
Mon, 2 Jan 2017 07:23:57 +0000 (16:23 +0900)
This reverts commit b6c4e0bd4dc1920453fcd701b9527c9447e75f61.

elm-demo tizen->file selector menu didn't work after adding this patch.
need to check relation between this patch and elm-demo -> file selector menu

Change-Id: Ic3894231296f3ff909e551ea7d8fa0414426191b

src/lib/edje/edje_calc.c
src/lib/edje/edje_private.h

index 41cd508..30ba61d 100644 (file)
@@ -2615,7 +2615,7 @@ _edje_part_recalc_single_min_max(FLOAT_T sc,
      }
 
    *minw = mnw;
-   if (ep->part->scale) *minw = TO_INT_ROUND(SCALE(sc, *minw));
+   if (ep->part->scale) *minw = TO_INT(SCALE(sc, *minw));
    if ((ep->type == EDJE_RP_TYPE_SWALLOW) &&
        (ep->typedata.swallow))
      {
@@ -2642,7 +2642,7 @@ _edje_part_recalc_single_min_max(FLOAT_T sc,
              *maxw = mxw;
              if (*maxw > 0)
                {
-                  if (ep->part->scale) *maxw = TO_INT_ROUND(SCALE(sc, *maxw));
+                  if (ep->part->scale) *maxw = TO_INT(SCALE(sc, *maxw));
                   if (*maxw < 1) *maxw = 1;
                }
           }
@@ -2655,7 +2655,7 @@ _edje_part_recalc_single_min_max(FLOAT_T sc,
                   *maxw = mxw;
                   if (*maxw > 0)
                     {
-                       if (ep->part->scale) *maxw = TO_INT_ROUND(SCALE(sc, *maxw));
+                       if (ep->part->scale) *maxw = TO_INT(SCALE(sc, *maxw));
                        if (*maxw < 1) *maxw = 1;
                     }
                   if (ep->typedata.swallow->swallow_params.max.w < *maxw)
@@ -2668,7 +2668,7 @@ _edje_part_recalc_single_min_max(FLOAT_T sc,
         *maxw = mxw;
         if (*maxw > 0)
           {
-             if (ep->part->scale) *maxw = TO_INT_ROUND(SCALE(sc, *maxw));
+             if (ep->part->scale) *maxw = TO_INT(SCALE(sc, *maxw));
              if (*maxw < 1) *maxw = 1;
           }
      }
@@ -2680,7 +2680,7 @@ _edje_part_recalc_single_min_max(FLOAT_T sc,
      }
 
    *minh = mnh;
-   if (ep->part->scale) *minh = TO_INT_ROUND(SCALE(sc, *minh));
+   if (ep->part->scale) *minh = TO_INT(SCALE(sc, *minh));
    if ((ep->type == EDJE_RP_TYPE_SWALLOW) &&
        (ep->typedata.swallow))
      {
@@ -2707,7 +2707,7 @@ _edje_part_recalc_single_min_max(FLOAT_T sc,
              *maxh = mxh;
              if (*maxh > 0)
                {
-                  if (ep->part->scale) *maxh = TO_INT_ROUND(SCALE(sc, *maxh));
+                  if (ep->part->scale) *maxh = TO_INT(SCALE(sc, *maxh));
                   if (*maxh < 1) *maxh = 1;
                }
           }
@@ -2720,7 +2720,7 @@ _edje_part_recalc_single_min_max(FLOAT_T sc,
                   *maxh = mxh;
                   if (*maxh > 0)
                     {
-                       if (ep->part->scale) *maxh = TO_INT_ROUND(SCALE(sc, *maxh));
+                       if (ep->part->scale) *maxh = TO_INT(SCALE(sc, *maxh));
                        if (*maxh < 1) *maxh = 1;
                     }
                   if (ep->typedata.swallow->swallow_params.max.h < *maxh)
@@ -2733,7 +2733,7 @@ _edje_part_recalc_single_min_max(FLOAT_T sc,
         *maxh = mxh;
         if (*maxh > 0)
           {
-             if (ep->part->scale) *maxh = TO_INT_ROUND(SCALE(sc, *maxh));
+             if (ep->part->scale) *maxh = TO_INT(SCALE(sc, *maxh));
              if (*maxh < 1) *maxh = 1;
           }
      }
index f23a927..9a74af8 100644 (file)
@@ -150,7 +150,6 @@ EAPI extern int _edje_default_log_dom ;
 #define FROM_DOUBLE(a) eina_f32p32_double_from(a)
 #define FROM_INT(a) eina_f32p32_int_from(a)
 #define TO_INT(a) eina_f32p32_int_to(a)
-#define TO_INT_ROUND(a) eina_f32p32_int_to(ADD(a, FROM_DOUBLE(0.5)))
 #define ZERO 0
 #define COS(a) eina_f32p32_cos(a)
 #define SIN(a) eina_f32p32_sin(a)
@@ -171,7 +170,6 @@ EAPI extern int _edje_default_log_dom ;
 #define FROM_DOUBLE(a) (a)
 #define FROM_INT(a) (double)(a)
 #define TO_INT(a) (int)(a)
-#define TO_INT_ROUND(a) (int)(a + 0.5)
 #define ZERO 0.0
 #define COS(a) cos(a)
 #define SIN(a) sin(a)