Skip to content

Commit

Permalink
Fix #2469
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketRobz committed Sep 9, 2024
1 parent fdb5b1e commit ca1dd25
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions romsel_aktheme/arm9/source/fileBrowse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
#define ENTRIES_PER_SCREEN 4
#define ENTRIES_PER_SCREEN_SMALL 8
#define ENTRIES_PER_SCREEN_LIST 10
#define ENTRY_PAGE_LENGTH 10

extern bool lcdSwapped;

Expand Down Expand Up @@ -1506,17 +1505,17 @@ std::string browseForFile(const std::vector<std::string_view> extensionList) {
resetIconScale();
}
if (pressed & KEY_LEFT) {
fileOffset -= ENTRY_PAGE_LENGTH;
screenOffset -= ENTRY_PAGE_LENGTH;
fileOffset -= entriesPerScreen;
screenOffset -= entriesPerScreen;
if (fileOffset < 0) fileOffset = 0;
if (screenOffset < 0) screenOffset = 0;
cursorPosOnScreen = fileOffset - screenOffset;
if (cursorPosOnScreen < 0) cursorPosOnScreen = 0;
resetIconScale();
}
if (pressed & KEY_RIGHT) {
fileOffset += ENTRY_PAGE_LENGTH;
screenOffset += ENTRY_PAGE_LENGTH;
fileOffset += entriesPerScreen;
screenOffset += entriesPerScreen;
if (fileOffset > (int)dirContents.size() - 1) fileOffset = (int)dirContents.size() - 1;
if (screenOffset > (int)dirContents.size() - entriesPerScreen) screenOffset = (int)dirContents.size() - entriesPerScreen;
cursorPosOnScreen = fileOffset - screenOffset;
Expand Down

0 comments on commit ca1dd25

Please sign in to comment.