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) {
|
if(newPos != cursorPos) {
|
||||||
int offset = offsets[page->cursor];
|
|
||||||
|
|
||||||
|
int offset = offsets[page->cursor];
|
||||||
drawMenuCursor(cursorPos-offset, BLACK); // Clear old cursor
|
drawMenuCursor(cursorPos-offset, BLACK); // Clear old cursor
|
||||||
|
|
||||||
|
if(page->numEntries >= MENU_NUM_ROWS) {
|
||||||
// Handle scrolling..
|
// Handle scrolling..
|
||||||
if((newPos - offset) > (MENU_NUM_ROWS-2) ) {
|
if((newPos - offset) > (MENU_NUM_ROWS-2) ) {
|
||||||
offset = newPos - (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;
|
offsets[page->cursor] = offset;
|
||||||
plotMenuEntries(page, true);
|
plotMenuEntries(page, true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
drawMenuCursor(newPos-offset, WHITE);
|
drawMenuCursor(newPos-offset, WHITE);
|
||||||
cursorNow = BLACK;
|
cursorNow = BLACK;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue