mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-01 10:21:59 +00:00
feat(l1): Home pages slide sideways, the page pill glides along
DisplayDriver gains slideBegin()/slideCompose(): the driver keeps the frame on screen and, in the next one, moves it out while the new rows follow. SH1106 does it on its 1 KB buffer (+1 KB RAM for the copy), the sim on its canvas; drivers that can't read their frame back keep cutting over (e-ink). Home slides the content below the page-icon row in 220 ms with an ease-out (the whole screen to and from the header-less clock), and the current-page pill glides between icons. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -356,6 +356,28 @@ public:
|
||||
// codepoint and call getTextWidth() on it.
|
||||
uint16_t getCodepointWidth(uint32_t cp) override;
|
||||
|
||||
// The canvas is the frame (128x64 native, CSS-scaled), so the slide reads
|
||||
// it back: the kept rows now, the new ones at compose time.
|
||||
bool slideBegin(int y0) override {
|
||||
EM_ASM({
|
||||
if (!Module.__simCtx) return;
|
||||
Module.__simSlideY = $0;
|
||||
Module.__simSlide = Module.__simCtx.getImageData(0, $0, 128, 64 - $0);
|
||||
}, y0);
|
||||
return true;
|
||||
}
|
||||
void slideCompose(int dx) override {
|
||||
EM_ASM({
|
||||
var c = Module.__simCtx;
|
||||
var old = Module.__simSlide;
|
||||
if (!c || !old) return;
|
||||
var y = Module.__simSlideY;
|
||||
var fresh = c.getImageData(0, y, 128, 64 - y);
|
||||
c.putImageData(old, -$0, y);
|
||||
c.putImageData(fresh, $0 >= 0 ? 128 - $0 : -128 - $0, y);
|
||||
}, dx);
|
||||
}
|
||||
|
||||
// Every draw call above already lands directly on the visible canvas
|
||||
// (see the class comment) -- nothing left to flush.
|
||||
void endFrame() override { }
|
||||
|
||||
Reference in New Issue
Block a user