fix(input): align touch axes with panel

This commit is contained in:
2026-08-01 19:58:30 -04:00
parent 0bd953d596
commit dbabb03413
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -25,8 +25,8 @@ static int l_input_getRawTouch(lua_State* L) {
return 1;
}
TS_Point point = owner->touch.getPoint();
lua_pushinteger(L, point.x);
lua_pushinteger(L, point.y);
lua_pushinteger(L, point.x);
return 2;
}
+2 -2
View File
@@ -20,8 +20,8 @@ LuaApp* app(lua_State* L) { return *static_cast<LuaApp**>(lua_getextraspace(L));
void bindApp(lua_State* L, LuaApp* owner) { *static_cast<LuaApp**>(lua_getextraspace(L)) = owner; }
void LuaApp::mapTouch(TFT_eSPI& tft, const TS_Point& p, int16_t& x, int16_t& y) {
int16_t nx = constrain(map(p.x, settings.touchX0, settings.touchX1, 0, PANEL_W), 0, PANEL_W - 1);
int16_t ny = constrain(map(p.y, settings.touchY0, settings.touchY1, 0, PANEL_H), 0, PANEL_H - 1);
int16_t nx = constrain(map(p.y, settings.touchX0, settings.touchX1, 0, PANEL_W), 0, PANEL_W - 1);
int16_t ny = constrain(map(p.x, settings.touchY0, settings.touchY1, 0, PANEL_H), 0, PANEL_H - 1);
switch (tft.getRotation() & 3) {
case 1:
x = PANEL_H - 1 - ny;
+1 -1
View File
@@ -6,7 +6,7 @@
// Persisted as a Lua table literal in /settings.lua: the firmware already links
// Lua, so this needs no parser, and Lua apps can read the file with load().
struct Settings {
int16_t touchX0 = 200, touchY0 = 240, touchX1 = 3800, touchY1 = 3800;
int16_t touchX0 = 240, touchY0 = 3800, touchX1 = 3800, touchY1 = 200;
// Degrees clockwise, stored for humans editing the file; TFT_eSPI wants 0-3.
int16_t rotation = 0;
String wifiSsid;