From f2fbdccd53e411eac3962bd767fc55eebe27c3e7 Mon Sep 17 00:00:00 2001 From: jpirnay Date: Wed, 25 Feb 2026 10:15:30 +0100 Subject: [PATCH] fix: Fix coverRendered flag (#1154) ## Summary * **What is the goal of this PR?** During low memory situations (which I encounterde a lot during my recent bugfixing activities) a cover was considered rendered even if the buffer could not be stored. * **What changes are included?** Proper assignment of flag logic ## Additional Context - --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**NO**_ --- src/components/themes/BaseTheme.cpp | 2 +- src/components/themes/lyra/Lyra3CoversTheme.cpp | 2 +- src/components/themes/lyra/LyraTheme.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/themes/BaseTheme.cpp b/src/components/themes/BaseTheme.cpp index 2fcc9a9b..3425dac6 100644 --- a/src/components/themes/BaseTheme.cpp +++ b/src/components/themes/BaseTheme.cpp @@ -424,7 +424,7 @@ void BaseTheme::drawRecentBookCover(GfxRenderer& renderer, Rect rect, const std: // Store the buffer with cover image for fast navigation coverBufferStored = storeCoverBuffer(); - coverRendered = true; + coverRendered = coverBufferStored; // Only consider it rendered if we successfully stored the buffer // First render: if selected, draw selection indicators now if (bookSelected) { diff --git a/src/components/themes/lyra/Lyra3CoversTheme.cpp b/src/components/themes/lyra/Lyra3CoversTheme.cpp index 55d5dda5..adbae934 100644 --- a/src/components/themes/lyra/Lyra3CoversTheme.cpp +++ b/src/components/themes/lyra/Lyra3CoversTheme.cpp @@ -79,7 +79,7 @@ void Lyra3CoversTheme::drawRecentBookCover(GfxRenderer& renderer, Rect rect, con } coverBufferStored = storeCoverBuffer(); - coverRendered = true; + coverRendered = coverBufferStored; // Only consider it rendered if we successfully stored the buffer } for (int i = 0; i < std::min(static_cast(recentBooks.size()), Lyra3CoversMetrics::values.homeRecentBooksCount); diff --git a/src/components/themes/lyra/LyraTheme.cpp b/src/components/themes/lyra/LyraTheme.cpp index fd8fdbe7..5b2abd7c 100644 --- a/src/components/themes/lyra/LyraTheme.cpp +++ b/src/components/themes/lyra/LyraTheme.cpp @@ -464,7 +464,7 @@ void LyraTheme::drawRecentBookCover(GfxRenderer& renderer, Rect rect, const std: } coverBufferStored = storeCoverBuffer(); - coverRendered = true; + coverRendered = coverBufferStored; // Only consider it rendered if we successfully stored the buffer } bool bookSelected = (selectorIndex == 0);