Only handle scrolling if there are items to scroll
This commit is contained in:
parent
0e32077042
commit
73e6db7686
1 changed files with 13 additions and 11 deletions
|
@ -980,10 +980,11 @@ static bool updateMenuPage(const MenuPage *page, KeyState &input, uint32_t timeN
|
|||
}
|
||||
|
||||
if(newPos != cursorPos) {
|
||||
int offset = offsets[page->cursor];
|
||||
|
||||
int offset = offsets[page->cursor];
|
||||
drawMenuCursor(cursorPos-offset, BLACK); // Clear old cursor
|
||||
|
||||
if(page->numEntries >= MENU_NUM_ROWS) {
|
||||
// Handle scrolling..
|
||||
if((newPos - offset) > (MENU_NUM_ROWS-2) ) {
|
||||
offset = newPos - (MENU_NUM_ROWS-2);
|
||||
|
@ -997,6 +998,7 @@ static bool updateMenuPage(const MenuPage *page, KeyState &input, uint32_t timeN
|
|||
offsets[page->cursor] = offset;
|
||||
plotMenuEntries(page, true);
|
||||
}
|
||||
}
|
||||
|
||||
drawMenuCursor(newPos-offset, WHITE);
|
||||
cursorNow = BLACK;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue