fix(arc) fix full arc invalidation

fixes #2490
This commit is contained in:
Gabor Kiss-Vamosi
2021-08-25 13:08:34 +02:00
parent 088b2bd490
commit 98b9ce5997
2 changed files with 14 additions and 7 deletions

View File

@@ -219,10 +219,20 @@ void lv_draw_arc(lv_coord_t center_x, lv_coord_t center_y, uint16_t radius, uin
void lv_draw_arc_get_area(lv_coord_t x, lv_coord_t y, uint16_t radius, uint16_t start_angle, uint16_t end_angle, lv_coord_t w, bool rounded, lv_area_t * area)
{
lv_coord_t rout = radius;
/*Special case: full arc invalidation */
if(end_angle == start_angle + 360) {
area->x1 = x - rout;
area->y1 = y - rout;
area->x2 = x + rout;
area->y2 = y + rout;
return;
}
if(start_angle > 360) start_angle -= 360;
if(end_angle > 360) end_angle -= 360;
lv_coord_t rout = radius;
lv_coord_t rin = radius - w;
lv_coord_t extra_area = rounded ? w / 2 + 1 : 0;
uint8_t start_quarter = start_angle / 90;