From 8b3d2c7ef067fed64f9396229a5ff2b8b0887cf7 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 19 Jul 2020 19:50:14 +0200 Subject: [PATCH] Fixed a bug where SystemView wouldn't properly loop the systems. --- NEWS.md | 1 + es-app/src/views/SystemView.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 2ac61ee5a..b84a783ac 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 diff --git a/es-app/src/views/SystemView.cpp b/es-app/src/views/SystemView.cpp index 169ab6b21..7b542b8b3 100644 --- a/es-app/src/views/SystemView.cpp +++ b/es-app/src/views/SystemView.cpp @@ -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).