Skip to content

Commit

Permalink
Fix inverted vertical
Browse files Browse the repository at this point in the history
  • Loading branch information
suchmememanyskill committed Mar 13, 2024
1 parent be3b2dd commit a7bde99
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions CYD-Klipper/src/core/device/ESP32-3248S035C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a7bde99

Please sign in to comment.