From a627c51118786a8672568bb509b8afa8e4b1a6da Mon Sep 17 00:00:00 2001 From: Calvin Hass Date: Tue, 21 May 2019 07:13:19 -0700 Subject: [PATCH] Fix getTouch() return status upon bounds overflow - When the post-remapped coordinates exceed screen bounds, `getTouch()` was returning a "valid" status without updating the coordinates. This would result in spurious touch detection events at the screen boundaries. - The fix ensures that the return value is set to "invalid" in this boundary condition. --- Extensions/Touch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extensions/Touch.cpp b/Extensions/Touch.cpp index 3f45102..cb253be 100644 --- a/Extensions/Touch.cpp +++ b/Extensions/Touch.cpp @@ -141,7 +141,7 @@ uint8_t TFT_eSPI::getTouch(uint16_t *x, uint16_t *y, uint16_t threshold){ convertRawXY(&x_tmp, &y_tmp); - if (x_tmp >= _width || y_tmp >= _height) return valid; + if (x_tmp >= _width || y_tmp >= _height) return false; _pressX = x_tmp; _pressY = y_tmp;