fix(ui): e-ink block char position in default-font path

In GxEPDDisplay::print(), the 0xDB fallback block was drawn at
cy - 8*scale, which assumed the Lemon baseline convention
(cy = original_y + 8*scale). For the default GFX font fontAscender
returns 0, so cy = original_y (top of cell) — the block landed
16 px above the character on e-ink (scale=2).

Fix: draw at cy (top of cell) for the non-Lemon path.

Also remove the unused forceNextRefreshFull() virtual from
DisplayDriver — it was added based on a wrong hypothesis (partial
refresh ghosting) and was never wired into endFrame().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-05-27 17:33:31 +02:00
parent 64b924a9c7
commit 2e3d6381a4
2 changed files with 3 additions and 2 deletions

View File

@@ -34,7 +34,6 @@ public:
virtual int getLineHeight() const { return 8; } // pixel rows per text line
virtual void setLemonFont(bool) { } // no-op; overridden by displays that support Lemon
virtual bool isLemonFont() const { return false; }
// Layout helpers — derived from font metrics and screen size.
// Use these instead of hardcoded pixel values so layouts adapt to any display.
int lineStep() const { return getLineHeight() + 2; } // row pitch: text + gap

View File

@@ -196,7 +196,9 @@ void GxEPDDisplay::print(const char* str) {
if ((uint8_t)*p == 0xDB) {
int cx = display.getCursorX();
int cy = display.getCursorY();
display.fillRect(cx, cy - 8 * sc, 5 * sc, 8 * sc, _curr_color);
// Default GFX font: cursor is top-left of cell (fontAscender=0), so cy=original_y.
// Draw block at cy (not cy-8*sc — that formula assumes Lemon's baseline offset).
display.fillRect(cx, cy, 5 * sc, 8 * sc, _curr_color);
display.setCursor(cx + 6 * sc, cy);
} else {
char tmp[2] = {*p, 0};