fix rounded-ending arc
@@ -243,8 +243,8 @@ static lv_design_res_t lv_arc_design(lv_obj_t * arc, const lv_area_t * clip_area
/*Draw circle on the ends if enabled */
if(style->line.rounded) {
lv_coord_t thick_half = style->line.width / 2;
- lv_coord_t cir_x = ((r - thick_half) * lv_trigo_sin(ext->angle_start) >> LV_TRIGO_SHIFT);
- lv_coord_t cir_y = ((r - thick_half) * lv_trigo_sin(ext->angle_start + 90) >> LV_TRIGO_SHIFT);
+ lv_coord_t cir_x = ((r - thick_half + 1) * lv_trigo_sin(90 - ext->angle_start) >> LV_TRIGO_SHIFT);
+ lv_coord_t cir_y = ((r - thick_half + 1) * lv_trigo_sin(ext->angle_start) >> LV_TRIGO_SHIFT);
lv_style_t cir_style;
lv_style_copy(&cir_style, &lv_style_plain);
@@ -252,18 +252,18 @@ static lv_design_res_t lv_arc_design(lv_obj_t * arc, const lv_area_t * clip_area
cir_style.body.main_color = cir_style.body.grad_color;
cir_style.body.radius = LV_RADIUS_CIRCLE;
lv_area_t cir_area;
- cir_area.x1 = cir_x + x - thick_half;
- cir_area.y1 = cir_y + y - thick_half;
+ cir_area.x1 = cir_x + x - thick_half +1;
+ cir_area.y1 = cir_y + y - thick_half +1;
cir_area.x2 = cir_x + x + thick_half;
cir_area.y2 = cir_y + y + thick_half;
lv_draw_rect(&cir_area, clip_area, &cir_style, opa_scale);
- cir_x = ((r - thick_half) * lv_trigo_sin(ext->angle_end) >> LV_TRIGO_SHIFT);
- cir_y = ((r - thick_half) * lv_trigo_sin(ext->angle_end + 90) >> LV_TRIGO_SHIFT);
+ cir_x = ((r - thick_half + 1) * lv_trigo_sin(90 - ext->angle_end) >> LV_TRIGO_SHIFT);
+ cir_y = ((r - thick_half + 1) * lv_trigo_sin(ext->angle_end) >> LV_TRIGO_SHIFT);
- cir_area.x1 = cir_x + x - thick_half;
- cir_area.y1 = cir_y + y - thick_half;
+ cir_area.x1 = cir_x + x - thick_half +1;
+ cir_area.y1 = cir_y + y - thick_half +1;
cir_area.x2 = cir_x + x + thick_half;
cir_area.y2 = cir_y + y + thick_half;
