From: Michal Szczecinski Date: Mon, 24 May 2021 06:31:27 +0000 (+0200) Subject: evas vg: Keep vg shape backward compatibility. X-Git-Tag: accepted/tizen/unified/20210602.122542~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3d636dfb8aeaaca6b5e90238c77dc29edffaf5d6;p=platform%2Fupstream%2Fefl.git 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 --- 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