tizen_vector: Fixed the integer division issue. 47/143647/1
authorsmohanty <smohantty@gmail.com>
Fri, 11 Aug 2017 00:14:08 +0000 (09:14 +0900)
committersmohanty <smohantty@gmail.com>
Fri, 11 Aug 2017 00:37:52 +0000 (09:37 +0900)
Change-Id: Ib17b7a440cdc5807059774ddd0031e17b42be400

src/lib/tizen_vector.c

index 23a602e..db1d88b 100644 (file)
@@ -60,13 +60,13 @@ _radio_bg_update(vg_radio *vd)
    Efl_VG * shape = vd->shape[0];
    evas_object_geometry_get(vd->vg[0], NULL, NULL, &w, &h);
    evas_vg_shape_reset(shape);
-   double r = w/2;
+   double r = w/2.0;
    if (on_case)
      r -= 1; // 1 pixel margin
    else
      r -= 2; // 2 pixel margin
 
-   evas_vg_shape_append_circle(shape, w/2, h/2, r);
+   evas_vg_shape_append_circle(shape, w/2.0, h/2.0, r);
 }
 
 static void
@@ -1636,12 +1636,12 @@ transit_progressbar_normal_op1(Elm_Transit_Effect *effect, Elm_Transit *transit
    evas_vg_node_color_set(vd->shape[1], 255, 255, 255, 255);
    evas_vg_shape_reset(vd->shape[1]);
    Evas_Coord start_width = vd->x + vd->h;
-   evas_vg_shape_append_rect(vd->shape[1], 0, 0, start_width + (vd->w - start_width)* progress, vd->h, vd->h/2, vd->h/2);
+   evas_vg_shape_append_rect(vd->shape[1], 0, 0, start_width + (vd->w - start_width)* progress, vd->h, vd->h/2.0, vd->h/2.0);
 
    evas_vg_node_color_set(vd->shape[2], 255, 255, 255, 255);
    evas_vg_shape_reset(vd->shape[2]);
    Evas_Coord delta_width = (vd->w - vd->x - vd->h) * progress;
-   evas_vg_shape_append_rect(vd->shape[2], vd->x, 0, vd->h + delta_width, vd->h, vd->h/2, vd->h/2);
+   evas_vg_shape_append_rect(vd->shape[2], vd->x, 0, vd->h + delta_width, vd->h, vd->h/2.0, vd->h/2.0);
 
 }
 
@@ -1652,7 +1652,7 @@ transit_progressbar_normal_op2(Elm_Transit_Effect *effect, Elm_Transit *transit
    evas_vg_node_color_set(vd->shape[2], 255, 255, 255, 255);
    evas_vg_shape_reset(vd->shape[2]);
    Evas_Coord delta_move =  (vd->w - vd->x - vd->h) * progress;
-   evas_vg_shape_append_rect(vd->shape[2], vd->x + delta_move, 0, vd->w - vd->x - delta_move, vd->h, vd->h/2, vd->h/2);
+   evas_vg_shape_append_rect(vd->shape[2], vd->x + delta_move, 0, vd->w - vd->x - delta_move, vd->h, vd->h/2.0, vd->h/2.0);
 }
 
 static void
@@ -1684,7 +1684,7 @@ progressbar_normal_bg_resize_cb(void *data , Evas *e EINA_UNUSED,
    evas_object_geometry_get(vd->vg[0], &x, &y, &w, &h);
    evas_vg_node_color_set(vd->shape[0], 255, 255, 255, 255);
    evas_vg_shape_reset(vd->shape[0]);
-   evas_vg_shape_append_rect(vd->shape[0], 0, 0, w, h, h/2, h/2);
+   evas_vg_shape_append_rect(vd->shape[0], 0, 0, w, h, h/2.0, h/2.0);
 }
 
 static void
@@ -2158,7 +2158,7 @@ _append_circle(Efl_VG *shape, double cx, double cy, double r)
 static void
 _append_round_rect(Efl_VG *shape, int w, int h)
 {
-   double radius = w/2 > h/2 ? h/2 : w/2;
+   double radius = w > h ? h/2.0 : w/2.0;
    evas_vg_shape_reset(shape);
    evas_vg_shape_append_rect(shape, 0, 0, w, h, radius, radius);
 }