UI: Fixed mismatch between visible and selectable menu elements

replace/d8e38f72ab27d9a646d0428b45886f66b6e1afd3
Federico Amedeo Izzo 2021-02-20 15:47:41 +01:00
rodzic c644e8db1d
commit 9c47797ff0
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -29,7 +29,7 @@ void _ui_drawMenuList(uint8_t selected, int (*getCurrentEntry)(char *buf, uint8_
{
point_t pos = layout.line1_pos;
// Number of menu entries that fit in the screen height
uint8_t entries_in_screen = (SCREEN_HEIGHT - layout.top_h) / layout.line1_h;
uint8_t entries_in_screen = (SCREEN_HEIGHT - 1 - pos.y) / layout.top_h + 1;
uint8_t scroll = 0;
char entry_buf[MAX_ENTRY_LEN] = "";
color_t text_color = color_white;
@ -62,7 +62,7 @@ void _ui_drawMenuListValue(ui_state_t* ui_state, uint8_t selected,
{
point_t pos = layout.line1_pos;
// Number of menu entries that fit in the screen height
uint8_t entries_in_screen = (SCREEN_HEIGHT - layout.top_h) / layout.line1_h;
uint8_t entries_in_screen = (SCREEN_HEIGHT - 1 - pos.y) / layout.top_h + 1;
uint8_t scroll = 0;
char entry_buf[MAX_ENTRY_LEN] = "";
char value_buf[MAX_ENTRY_LEN] = "";