fix: placeholder cover text, indexing timing, TOC long-press, cache deletion UI

- Fix fp4 fixed-point misuse in PlaceholderCoverGenerator (advanceX is 12.4
  fixed-point, not pixels) causing only first letter of each word to render
- Remove duplicate silentIndexNextChapterIfNeeded() call from loop() that
  blocked UI before render, preventing the indexing indicator from showing
- Fix indexing icon Y position to align within the status bar
- Add ignoreNextConfirmRelease to EpubReaderChapterSelectionActivity so
  long-press confirm release doesn't immediately select the first TOC item
- Reload recent books after cache deletion in HomeActivity and clear stale
  ignoreNextConfirmRelease flag to fix "no open books" and double-press bugs

Made-with: Cursor
This commit is contained in:
cottongin
2026-03-07 22:58:13 -05:00
parent a5ca15df4f
commit 022f5197d7
5 changed files with 17 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
#include "PlaceholderCoverGenerator.h"
#include <EpdFont.h>
#include <EpdFontData.h>
#include <HalStorage.h>
#include <Logging.h>
#include <Utf8.h>
@@ -170,7 +171,7 @@ class PixelBuffer {
}
}
return glyph->advanceX * scale;
return fp4::toPixel(glyph->advanceX) * scale;
}
/// Render a UTF-8 string at (x, y) where y is the top of the text line, with integer scaling.
@@ -232,7 +233,7 @@ int getCharAdvance(const EpdFontData* font, uint32_t cp) {
const EpdFont fontObj(font);
const EpdGlyph* glyph = fontObj.getGlyph(cp);
if (!glyph) return 0;
return glyph->advanceX;
return fp4::toPixel(glyph->advanceX);
}
/// Split a string into words (splitting on whitespace: space, newline, tab, CR).