Cleanup indexing layout string

This commit is contained in:
Dave Allie 2025-12-20 00:33:55 +11:00
parent 10d76dde12
commit cf6fec78dc
No known key found for this signature in database
GPG Key ID: F2FDDB3AD8D0276F

View File

@ -214,12 +214,11 @@ void EpubReaderActivity::renderScreen() {
{ {
const int textWidth = renderer.getTextWidth(READER_FONT_ID, "Indexing..."); const int textWidth = renderer.getTextWidth(READER_FONT_ID, "Indexing...");
constexpr int margin = 20; constexpr int margin = 20;
// Round all coordinates to 8 pixel boundaries const int x = (GfxRenderer::getScreenWidth() - textWidth - margin * 2) / 2;
const int x = ((GfxRenderer::getScreenWidth() - textWidth - margin * 2) / 2 + 7) / 8 * 8; constexpr int y = 50;
constexpr int y = 56; const int w = textWidth + margin * 2;
const int w = (textWidth + margin * 2 + 7) / 8 * 8; const int h = renderer.getLineHeight(READER_FONT_ID) + margin * 2;
const int h = (renderer.getLineHeight(READER_FONT_ID) + margin * 2 + 7) / 8 * 8; renderer.fillRect(x, y, w, h, false);
renderer.clearScreen();
renderer.drawText(READER_FONT_ID, x + margin, y + margin, "Indexing..."); renderer.drawText(READER_FONT_ID, x + margin, y + margin, "Indexing...");
renderer.drawRect(x + 5, y + 5, w - 10, h - 10); renderer.drawRect(x + 5, y + 5, w - 10, h - 10);
renderer.displayBuffer(); renderer.displayBuffer();