Add icon rendering and list scroll gesture support

Implement orientation-aware icon rendering using freeink::Icon format that applies rotation transforms per-pixel. Add wasListScroll helper for touch-based list navigation with swipe gestures. Switch vertical centering from x-height to cap-height for better visual alignment with capital-led UI labels.
This commit is contained in:
Justin Mitchell
2026-06-15 23:37:49 -04:00
parent e103cdfd11
commit 4a5b45409f
20 changed files with 339 additions and 96 deletions
+16
View File
@@ -2,6 +2,7 @@
#include <GfxRenderer.h>
#include <algorithm>
#include <cstdlib>
#include "CrossPointSettings.h"
@@ -118,6 +119,21 @@ bool MappedInputManager::wasCoverTapped(int& id) const {
return TouchRegistry::getInstance().hitTest(lx, ly, TouchRegistry::Cover, id);
}
bool MappedInputManager::wasListScroll(int& index, int count, int pageItems) const {
if (count <= 0) return false;
if (pageItems < 1) pageItems = 1;
const SwipeDir swipe = wasSwipe();
if (swipe == SwipeDir::Up) {
index = std::min(index + pageItems, count - 1);
return true;
}
if (swipe == SwipeDir::Down) {
index = std::max(index - pageItems, 0);
return true;
}
return false;
}
MappedInputManager::SwipeDir MappedInputManager::wasSwipe() const {
float nxs = 0.0f, nys = 0.0f, nxe = 0.0f, nye = 0.0f;
if (!gpio.wasSwipe(nxs, nys, nxe, nye)) return SwipeDir::None;