mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 06:37:38 +03:00
Fix scrolling wrap-around in settings menu (#249)
## Summary Fixes a bug in the settings menu, where previously wrap-around only worked when scrolling upwards. Now, scrolling downwards on the last list element wraps around to the top as expected. Resolves #236.
This commit is contained in:
parent
14972b34cb
commit
881aa2e005
@ -114,12 +114,10 @@ void SettingsActivity::loop() {
|
||||
updateRequired = true;
|
||||
} else if (mappedInput.wasPressed(MappedInputManager::Button::Down) ||
|
||||
mappedInput.wasPressed(MappedInputManager::Button::Right)) {
|
||||
// Move selection down
|
||||
if (selectedSettingIndex < settingsCount - 1) {
|
||||
selectedSettingIndex++;
|
||||
// Move selection down (with wrap around)
|
||||
selectedSettingIndex = (selectedSettingIndex < settingsCount - 1) ? (selectedSettingIndex + 1) : 0;
|
||||
updateRequired = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsActivity::toggleCurrentSetting() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user