What changed and what to expect:

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.
This commit is contained in:
pelgraine
2026-06-03 19:24:19 +10:00
parent 6487fcf4e6
commit 70e150e9c3
3 changed files with 167 additions and 23 deletions
+3
View File
@@ -184,6 +184,7 @@ lib_deps =
${LilyGo_TDeck_Pro_Max.lib_deps}
densaugeo/base64 @ ~1.4.0
bitbank2/JPEGDEC
bitbank2/PNGdec
; MAX + WiFi companion (WiFi app bridging — no BLE, higher contact limit)
; WiFi credentials loaded from SD card (/web/wifi.cfg).
@@ -212,6 +213,7 @@ lib_deps =
${LilyGo_TDeck_Pro_Max.lib_deps}
densaugeo/base64 @ ~1.4.0
bitbank2/JPEGDEC
bitbank2/PNGdec
; MAX standalone (no BLE/WiFi — maximum battery life, LoRa mesh only)
; Contacts in PSRAM (1500 capacity). OTA enabled (WiFi AP on demand).
@@ -233,4 +235,5 @@ build_src_filter = ${LilyGo_TDeck_Pro_Max.build_src_filter}
+<helpers/ui/GxEPDDisplay.cpp>
lib_deps =
${LilyGo_TDeck_Pro_Max.lib_deps}
bitbank2/PNGdec
densaugeo/base64 @ ~1.4.0