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

fix(arc): fix bug with LV_ARC_MODE_REVERSE (#3417) (#3418)

This commit is contained in:
jadonmmiller 2022-07-04 07:06:26 -04:00 committed by GitHub
parent a1326dc31a
commit a06e11478e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -820,7 +820,7 @@ static void value_update(lv_obj_t * obj)
}
break;
case LV_ARC_MODE_REVERSE:
angle = lv_map(arc->value, arc->min_value, arc->max_value, arc->bg_angle_start, bg_end);
angle = lv_map(arc->value, arc->min_value, arc->max_value, bg_end, arc->bg_angle_start);
lv_arc_set_angles(obj, angle, arc->bg_angle_end);
break;
case LV_ARC_MODE_NORMAL:

View File

@ -105,7 +105,7 @@ void test_arc_should_update_angles_when_changing_to_symmetrical_mode_value_more_
/* See #2522 for more information */
void test_arc_angles_when_reversed(void)
{
uint16_t expected_start_angle = 36;
uint16_t expected_start_angle = 54;
uint16_t expected_end_angle = 90;
int16_t expected_value = 40;