evas vg: shape_reset() only requires reset path. 30/255130/2
authorHermet Park <chuneon.park@samsung.com>
Fri, 12 Mar 2021 09:24:46 +0000 (18:24 +0900)
committerHermet Park <chuneon.park@samsung.com>
Fri, 12 Mar 2021 09:31:33 +0000 (09:31 +0000)
it should not reset any other properties.

Change-Id: I5bfdf86cbdf85aae7fbef57438b214bddd6ef0e0

src/lib/evas/canvas/efl_canvas_vg_shape.c

index 76c8d5b..9f575c8 100644 (file)
@@ -358,37 +358,6 @@ _append_arc_to(Evas_Vg_Shape *obj, double x, double y,
 }
 
 static void
-_shape_reset(Evas_Vg_Shape *obj)
-{
-   Efl_Canvas_Vg_Node_Data *nd = NULL;
-   Efl_Canvas_Vg_Shape_Data *sd = NULL;
-
-   uint8_t r, g, b, a;
-
-   if (!obj) return;
-
-   nd = efl_data_scope_get(obj, EFL_CANVAS_VG_NODE_CLASS);
-   sd = nd->data;
-
-   sd->curr_ctrl.x = sd->curr_ctrl.y = 0;
-   sd->curr.x = sd->curr.y = 0;
-   sd->cmd_prev = 0;
-   sd->start.x = sd->start.y = 0;
-
-   if (sd->fill)
-     {
-        efl_del(sd->fill);
-        sd->fill = NULL;
-     }
-
-   tvg_shape_get_stroke_color(sd->shape, &r, &g, &b, &a);
-   tvg_shape_reset(sd->shape);
-
-   tvg_shape_set_stroke_width(sd->shape, sd->scale * sd->width);
-   tvg_shape_set_stroke_color(sd->shape, r, g, b, a);
-}
-
-static void
 _shape_dup(Evas_Vg_Shape *obj, Evas_Vg_Shape *dup_from)
 {
    Efl_Canvas_Vg_Node_Data *nd_from = NULL;
@@ -1344,7 +1313,17 @@ EAPI void
 evas_vg_shape_reset(Evas_Vg_Shape *obj)
 {
 #ifdef HAVE_THORVG
-   _shape_reset(obj);
+   if (!obj) return;
+
+   Efl_Canvas_Vg_Node_Data* nd = efl_data_scope_get(obj, EFL_CANVAS_VG_NODE_CLASS);
+   Efl_Canvas_Vg_Shape_Data* sd = nd->data;
+
+   sd->curr_ctrl.x = sd->curr_ctrl.y = 0;
+   sd->curr.x = sd->curr.y = 0;
+   sd->cmd_prev = 0;
+   sd->start.x = sd->start.y = 0;
+
+   tvg_shape_reset(sd->shape);
 #else
    efl_gfx_path_reset(obj);
 #endif