Tvg_Point start;
Efl_Tvg_Path_Cmd_Type cmd_prev;
+ //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;
+
//Stroke scale is not supported by TVG. Scale variable is used to implement stroke
//scaling using scale * width
double scale;
nd->render_pre_tvg = _efl_canvas_vg_shape_render_pre_tvg;
pd->shape = tvg_shape_new();
pd->scale = 1.0;
+ pd->width = 0;
//default EFL implementation. We don't want to draw invisible shapes.
//when object is visible, renderer changes opacity to valid value.
evas_vg_shape_stroke_scale_set(Evas_Vg_Shape *obj, double s)
{
#ifdef HAVE_THORVG
- float width = 0;
Efl_Canvas_Vg_Shape_Data *sd = NULL;
if (!obj) return;
sd = _get_shape_data(obj);
if (!sd) return;
- tvg_shape_get_stroke_width(sd->shape, &width);
- width = width * s;
sd->scale = s;
- tvg_shape_set_stroke_width(sd->shape, width);
+ tvg_shape_set_stroke_width(sd->shape, sd->scale * sd->width);
#else
efl_gfx_shape_stroke_scale_set(obj, s);
#endif
evas_vg_shape_stroke_width_set(Evas_Vg_Shape *obj, double w)
{
#ifdef HAVE_THORVG
- tvg_shape_set_stroke_width(_get_tvg_shape(obj), w);
+ Efl_Canvas_Vg_Shape_Data *sd = NULL;
+ if (!obj) return;
+
+ sd = _get_shape_data(obj);
+ if (!sd) return;
+
+ sd->width = w;
+
+ tvg_shape_set_stroke_width(_get_tvg_shape(obj), sd->scale * sd->width);
#else
efl_gfx_shape_stroke_width_set(obj, w);
#endif