Skip to content

Commit

Permalink
Wood theme: Fix crash when pressing D-Pad Right with 2 files/folders …
Browse files Browse the repository at this point in the history
…or less on-screen
  • Loading branch information
RocketRobz committed Nov 2, 2024
1 parent cbf784f commit 1241805
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion romsel_aktheme/arm9/source/fileBrowse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1523,7 +1523,10 @@ std::string browseForFile(const std::vector<std::string_view> extensionList) {
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;
if (screenOffset > (int)dirContents.size() - entriesPerScreen) {
screenOffset = (int)dirContents.size() - entriesPerScreen;
if (screenOffset < 0) screenOffset = 0;
}
cursorPosOnScreen = fileOffset - screenOffset;
if (cursorPosOnScreen > entriesPerScreen - 1) cursorPosOnScreen = entriesPerScreen - 1;
resetIconScale();
Expand Down

0 comments on commit 1241805

Please sign in to comment.