From f5ca15b321f861bce59ec48905657a7a036d5d24 Mon Sep 17 00:00:00 2001 From: _VIFEXTech Date: Sat, 24 Feb 2024 21:02:03 +0800 Subject: [PATCH] fix(vg_lite): remove redundant MOVE_TO operations (#5713) Signed-off-by: pengyiqiang Co-authored-by: pengyiqiang --- src/draw/vg_lite/lv_draw_vg_lite_arc.c | 3 ++- src/draw/vg_lite/lv_vg_lite_path.c | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/draw/vg_lite/lv_draw_vg_lite_arc.c b/src/draw/vg_lite/lv_draw_vg_lite_arc.c index b471cebde..8046b1b2d 100644 --- a/src/draw/vg_lite/lv_draw_vg_lite_arc.c +++ b/src/draw/vg_lite/lv_draw_vg_lite_arc.c @@ -114,6 +114,8 @@ void lv_draw_vg_lite_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * d float end_x = radius_in * MATH_COSF(end_angle_rad) + cx; float end_y = radius_in * MATH_SINF(end_angle_rad) + cy; + lv_vg_lite_path_move_to(path, start_x, start_y); + /* radius_out arc */ lv_vg_lite_path_append_arc(path, cx, cy, @@ -134,7 +136,6 @@ void lv_draw_vg_lite_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * d false); /* close arc */ - lv_vg_lite_path_line_to(path, start_x, start_y); lv_vg_lite_path_close(path); /* draw round */ diff --git a/src/draw/vg_lite/lv_vg_lite_path.c b/src/draw/vg_lite/lv_vg_lite_path.c index 96dc14141..812cc7023 100644 --- a/src/draw/vg_lite/lv_vg_lite_path.c +++ b/src/draw/vg_lite/lv_vg_lite_path.c @@ -445,9 +445,6 @@ void lv_vg_lite_path_append_arc(lv_vg_lite_path_t * path, lv_vg_lite_path_move_to(path, cx, cy); lv_vg_lite_path_line_to(path, start_x + cx, start_y + cy); } - else { - lv_vg_lite_path_move_to(path, start_x + cx, start_y + cy); - } for(int i = 0; i < n_curves; ++i) { float end_angle = start_angle + ((i != n_curves - 1) ? MATH_HALF_PI * sweep_sign : fract);