From a7bde994423be76173400f60ea0cb3828af35888 Mon Sep 17 00:00:00 2001 From: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com> Date: Wed, 13 Mar 2024 20:20:57 +0100 Subject: [PATCH] Fix inverted vertical --- CYD-Klipper/src/core/device/ESP32-3248S035C.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CYD-Klipper/src/core/device/ESP32-3248S035C.cpp b/CYD-Klipper/src/core/device/ESP32-3248S035C.cpp index 715b38f..75c39b7 100644 --- a/CYD-Klipper/src/core/device/ESP32-3248S035C.cpp +++ b/CYD-Klipper/src/core/device/ESP32-3248S035C.cpp @@ -68,8 +68,14 @@ void screen_lv_touchRead(lv_indev_drv_t *indev_driver, lv_indev_data_t *data) } else { - magicY = TOUCH_WIDTH - tp.points[i].x; - magicX = tp.points[i].y; + #ifdef CYD_SCREEN_VERTICAL + // I don't even want to know why this works... + magicY = TOUCH_HEIGHT - tp.points[i].x; + magicX = tp.points[i].y - 160; + #else + magicY = TOUCH_WIDTH - tp.points[i].x; + magicX = tp.points[i].y; + #endif } data->point.x = magicX;