Fixed a bug where SystemView wouldn't properly loop the systems.

This commit is contained in:
Leon Styhre 2020-07-19 19:50:14 +02:00
parent ebc6aabe93
commit 8b3d2c7ef0
2 changed files with 3 additions and 2 deletions

View file

@ -43,4 +43,5 @@ v1.0.0
* Restart and power-off menu entries not working
* Toggling the screensaver didn't work as expected
* Deleting a game did not delete the game media files or its entry in the gamelist.xml file
* SystemView didn't properly loop the systems if only two systems were available
* Lots and lots of small bugs and inconsistencies fixed

View file

@ -244,9 +244,9 @@ void SystemView::onCursorChanged(const CursorState& /*state*/)
float endPos = target; // Directly.
float dist = abs(endPos - startPos);
if (abs(target + posMax - startPos) < dist)
if (abs(target + posMax - startPos - mScrollVelocity) < dist)
endPos = target + posMax; // Loop around the end (0 -> max).
if (abs(target - posMax - startPos) < dist)
if (abs(target - posMax - startPos - mScrollVelocity) < dist)
endPos = target - posMax; // Loop around the start (max - 1 -> -1).
// Animate mSystemInfo's opacity (fade out, wait, fade back in).