feat(display): draw hint animation at touch position instead of center

This commit is contained in:
2026-02-17 03:49:34 -08:00
parent 23712a152b
commit 0ace263324
9 changed files with 78 additions and 31 deletions

View File

@@ -28,18 +28,32 @@ void loop() {
// ── Touch handling ──
const ScreenState& st = logic.getScreenState();
static int holdStartX = -1;
static int holdStartY = -1;
if (st.deviceState == DeviceState::ALERTING) {
HoldState h = display.updateHold(HOLD_TO_SILENCE_MS);
if (h.completed) {
logic.silenceAlert();
holdStartX = -1;
holdStartY = -1;
}
if (!h.active) {
display.updateHint();
if (h.started) {
TouchEvent t = display.readTouch();
holdStartX = t.x;
holdStartY = t.y;
}
if (!h.active && holdStartX >= 0) {
display.updateHint(holdStartX, holdStartY);
}
} else {
holdStartX = -1;
holdStartY = -1;
}
if (st.screen == ScreenID::DASHBOARD) {
TouchEvent evt = display.readTouch();
if (evt.pressed && st.screen == ScreenID::DASHBOARD) {
if (evt.pressed) {
int tile = display.dashboardTouch(evt.x, evt.y);
if (tile >= 0) Serial.printf("[DASH] Tile %d tapped\n", tile);
}