mirror of
https://github.com/pelgraine/Meck.git
synced 2026-06-11 00:34:50 +02:00
70e150e9c3
The fix (six sites: 948, 978, 1519, 1651, 1719, 1906): the indexer now chooses pixel-vs-char wrapping from _display->getFontStyle(), the same basis the renderer (1200), the layout sizing (1336), and the cache key already use. With all four agreeing, the indexer's recorded page boundary lands on the exact byte where the renderer's height-based stop lands — no more swallowed run between pages. Version bump (INDEX_VERSION 13 → 14): your existing .idx caches were built by the old indexer and would otherwise be reloaded as-is (same font key), so the fix would appear to do nothing. Bumping the version makes the loader discard every v13 cache and rebuild it. All six edits are in and braces balance (267/267). Here's what changed in Audiobookplayerscreen.h: PNGdec include (47) and cover size 40→30 (67) — 30 virtual units ≈ 55px. PNG draw callback coverDrawCallbackPNG (147) — nearest-neighbour downscales the 256px source line-by-line and dithers to 1-bit using the same Bayer matrix as the JPEG path. The decoder is heap-allocated per-decode (new PNG()), mirroring how the JPEG path uses new JPEGDEC(), so there's no permanent BSS cost. decodeFolderCoverPNG() (419) + tryLoadFolderCover() (505) — reads cover.png from _currentPath into PSRAM and decodes it. Hooks in both openBook (1099) and advanceTrack (1198), so the cover loads on open and persists as tracks auto-advance within an album. It only loads when there's no embedded cover, so M4B/ID3 embedded art still wins; music (no embedded art) gets the folder PNG. Layout (1531, 1556) — cover now draws below the artist line, above the status/Paused-Vol line, exactly where you wanted it.