1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

arc draw: make full arcs special case

This commit is contained in:
Gabor Kiss-Vamosi 2020-02-05 23:12:24 +01:00
parent b3cce8a069
commit 9a8ce0d0e2

View File

@ -91,6 +91,12 @@ void lv_draw_arc(lv_coord_t center_x, lv_coord_t center_y, uint16_t radius, cons
area.x2 = center_x + radius - 1; /*-1 because the center already belongs to the left/bottom part*/
area.y2 = center_y + radius - 1;
/*Draw a full ring*/
if(start_angle + 360 == end_angle) {
lv_draw_rect(&area, clip_area, &circle_style, opa_scale);
return;
}
int32_t angle_gap;
if(end_angle > start_angle) {
angle_gap = 360 - (end_angle - start_angle);