fix: Lag before displaying covers on home screen (#721)

## Summary

Reduce/fix the lag on the home screen before recent book covers are
rendered

## Additional Context

We were previously rendering the screen in two steps, delaying the
recent book covers render to avoid a lag before the screen loads.
In this PR, we are now doing that only if at least one book doesn't have
the cover thumbnail generated yet. If all thumbs are already generated,
we load and display them right away, with no lag.

---

### 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 **_
This commit is contained in:
CaptainFrito
2026-02-06 14:58:32 +07:00
committed by GitHub
parent f89ce514c8
commit bd8132a260
8 changed files with 95 additions and 69 deletions

View File

@@ -340,7 +340,7 @@ bool Xtc::generateThumbBmp(int height) const {
// Calculate scale factor
float scaleX = static_cast<float>(THUMB_TARGET_WIDTH) / pageInfo.width;
float scaleY = static_cast<float>(THUMB_TARGET_HEIGHT) / pageInfo.height;
float scale = (scaleX < scaleY) ? scaleX : scaleY;
float scale = (scaleX > scaleY) ? scaleX : scaleY; // for cropping
// Only scale down, never up
if (scale >= 1.0f) {