From 3d636dfb8aeaaca6b5e90238c77dc29edffaf5d6 Mon Sep 17 00:00:00 2001 From: Michal Szczecinski Date: Mon, 24 May 2021 08:31:27 +0200 Subject: [PATCH] evas vg: Keep vg shape backward compatibility. 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 | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/lib/evas/canvas/efl_canvas_vg_shape.c b/src/lib/evas/canvas/efl_canvas_vg_shape.c index 57bc148..920c2ab 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_shape.c +++ b/src/lib/evas/canvas/efl_canvas_vg_shape.c @@ -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 -- 2.7.4