From 89cf82b88e0d034bca614e731044ac4b9dcd4db0 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 15 Jan 2022 19:28:41 +0100 Subject: [PATCH] When multi-scraping and scrolling a long name, the start position would sometimes not reset correctly. --- es-app/src/guis/GuiScraperSearch.cpp | 3 +-- es-core/src/components/ComponentList.h | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/es-app/src/guis/GuiScraperSearch.cpp b/es-app/src/guis/GuiScraperSearch.cpp index 4bcf5f5cb..8a4fc559a 100644 --- a/es-app/src/guis/GuiScraperSearch.cpp +++ b/es-app/src/guis/GuiScraperSearch.cpp @@ -598,6 +598,7 @@ bool GuiScraperSearch::input(InputConfig* config, Input input) if (config->isMappedTo("a", input) && input.value != 0) { if (mBlockAccept || mScraperResults.empty()) return true; + mResultList->setLoopRows(false); } // Check whether we should allow a refine of the game name. @@ -646,8 +647,6 @@ void GuiScraperSearch::render(const glm::mat4& parentTrans) void GuiScraperSearch::returnResult(ScraperSearchResult result) { - mResultList->setLoopRows(false); - mBlockAccept = true; mAcceptedResult = true; diff --git a/es-core/src/components/ComponentList.h b/es-core/src/components/ComponentList.h index 8b9d9f76c..5213e2c21 100644 --- a/es-core/src/components/ComponentList.h +++ b/es-core/src/components/ComponentList.h @@ -87,7 +87,11 @@ public: float getRowHeight(int row) const { return getRowHeight(mEntries.at(row).data); } // Horizontal looping for row content that doesn't fit on-screen. - void setLoopRows(bool state) { mLoopRows = state; } + void setLoopRows(bool state) + { + stopLooping(); + mLoopRows = state; + } void stopLooping() { mLoopOffset = 0;