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
2 changed files with 2 additions and 2 deletions

View File

@@ -820,7 +820,7 @@ static void value_update(lv_obj_t * obj)
} }
break; break;
case LV_ARC_MODE_REVERSE: 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); lv_arc_set_angles(obj, angle, arc->bg_angle_end);
break; break;
case LV_ARC_MODE_NORMAL: 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 */ /* See #2522 for more information */
void test_arc_angles_when_reversed(void) 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; uint16_t expected_end_angle = 90;
int16_t expected_value = 40; int16_t expected_value = 40;