evas vg: Keep vg shape backward compatibility. 77/258677/1
authorMichal Szczecinski <m.szczecinsk@partner.samsung.com>
Mon, 24 May 2021 06:31:27 +0000 (08:31 +0200)
committerMichal Szczecinski <m.szczecinsk@partner.samsung.com>
Mon, 24 May 2021 06:31:27 +0000 (08:31 +0200)
Thorvg don't support location set/get API. This commit keeps backward
compatibility for this feature in EFL.

Change-Id: Ic13d8ac05798715cb3f71dda8f362ac661427afb

src/lib/evas/canvas/efl_canvas_vg_shape.c

index 57bc148..920c2ab 100644 (file)
@@ -36,6 +36,9 @@ struct _Efl_Canvas_Vg_Shape_Data
    Tvg_Point start;
    Path_Cmd_Type cmd_prev;
 
+   //This is to keep backward comaptibility and pass EFL TESTS.
+   double location;
+
    //Storage for stroke's width passed in evas_vg_shape_stroke_width_set. Width variable is used to implement stroke
    //scaling using scale * width
    double width;
@@ -880,14 +883,23 @@ evas_vg_shape_stroke_width_set(Evas_Vg_Shape *obj, double w)
 EAPI double
 evas_vg_shape_stroke_location_get(Evas_Vg_Shape *obj)
 {
-   //TODO: implement
-   return 0.0;
+   if (!obj) return 0.0;
+
+   Efl_Canvas_Vg_Shape_Data *sd = _get_shape_data(obj);
+   if (!sd) return 0.0;
+
+   return sd->location;
 }
 
 EAPI void
 evas_vg_shape_stroke_location_set(Evas_Vg_Shape *obj, double centered)
 {
-   //TODO: implement
+   if (!obj) return;
+
+   Efl_Canvas_Vg_Shape_Data *sd = _get_shape_data(obj);
+   if (!sd) return;
+
+   sd->location = centered;
 }
 
 EAPI void