X and Y ranges swapped for touch only #3608
Unanswered
samjcarroll01
asked this question in
Q&A - Touch
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have developed a UI in Squareline Studio that displays in landscape mode on a 4" ST7796 with XTP2046 with a resolution of 480x320. The rotation for the display is set to 3. I have gone through the calibration and test sketches for touch functionality. Since it is in landscape mode, I expect the range of X values to be 0-480 and the range of Y values to be 0-320. I have found that in the sketch exported from Squareline when I press on the lower right corner, it returns values of Data x 315 and Data y 476. If I press the top right corner, I get Data x 317 and Data y 20 values. This indicates that the X and Y ranges are swapped, and because of this, the coordinates for any presses are incorrect and do not trigger the correct functions on the UI. I have to press above and to the right of any widgets on the screen to trigger a press event on them. Since the UI is displaying properly on the screen, I cannot just change the rotation value in
tft.setRotation()
. Is there a way to swap the ranges for the X and Y axes for touch only?Beta Was this translation helpful? Give feedback.
All reactions