This commit is contained in:
Gordon Williams 2022-12-15 14:12:42 +00:00
parent 8d0ae537ec
commit bb0e56594f

View File

@ -1765,8 +1765,8 @@ void touchHandler(bool state, IOEventFlags flags) {
int tx = buf[3]/* | ((buf[2] & 0x0F)<<8)*/; // top bits are never used on our touchscreen
int ty = buf[5]/* | ((buf[4] & 0x0F)<<8)*/;
if (tx>250) tx=0; // on some devices, 251-255 gets reported for touches right at the top of the screen
if (ty>250) ty=0;
if (tx>=250) tx=0; // on some devices, 251-255 gets reported for touches right at the top of the screen
if (ty>=250) ty=0;
touchHandlerInternal(
(tx-touchMinX) * LCD_WIDTH / (touchMaxX-touchMinX), // touchX
(ty-touchMinY) * LCD_HEIGHT / (touchMaxY-touchMinY), // touchY