[Button] apply radius change according to ratio to object
authorSung-Taek Hong <sth253.hong@samsung.com>
Tue, 18 Aug 2015 07:12:21 +0000 (16:12 +0900)
committerJaehwan Kim <jae.hwan.kim@samsung.com>
Tue, 17 Nov 2015 05:15:43 +0000 (14:15 +0900)
Change-Id: I1de77a7c2f7e8f6496d102b11b801f395672b5f3
Signed-off-by: Sung-Taek Hong <sth253.hong@samsung.com>
src/lib/tizen_vector.c

index 4fd6068fe89392a4812566782074ca8b13432de9..45c4bca00729afbfa218dcdc39cc953067065db1 100644 (file)
@@ -1214,7 +1214,14 @@ button_effect_no_bg_resize_cb(void *data, Evas *e EINA_UNUSED,
         evas_vg_shape_shape_append_circle(vd->shape[0], radius_w, radius_h, radius_w);
      }
    else
-     evas_vg_shape_shape_append_rect(vd->shape[0], 0, 0, w, h, vd->corner, vd->corner);
+     {
+        Evas_Coord w2, h2;
+        double effect_ratio;
+
+        evas_object_geometry_get(vd->obj, NULL, NULL, &w2, &h2);
+        effect_ratio = (w2 < h2) ? (double)w / w2 : (double)h / h2;
+        evas_vg_shape_shape_append_rect(vd->shape[0], 0, 0, w, h, vd->corner * effect_ratio, vd->corner * effect_ratio);
+     }
 }
 
 static void
@@ -1310,7 +1317,14 @@ button_effect_resize_cb(void *data, Evas *e EINA_UNUSED,
         evas_vg_shape_shape_append_circle(vd->shape[1], radius_w, radius_h, radius_w);
      }
    else
-     evas_vg_shape_shape_append_rect(vd->shape[1], 0, 0, w, h, vd->corner, vd->corner);
+     {
+        Evas_Coord w2, h2;
+        double effect_ratio;
+
+        evas_object_geometry_get(vd->vg[0], NULL, NULL, &w2, &h2);
+        effect_ratio = (w2 < h2) ? (double)w / w2 : (double)h / h2;
+        evas_vg_shape_shape_append_rect(vd->shape[1], 0, 0, w, h, vd->corner * effect_ratio, vd->corner * effect_ratio);
+     }
 }
 
 static void