summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Kling <webgeek1234@gmail.com>2021-02-21 22:34:09 -0600
committerRashed Abdel-Tawab <rashedabdeltawab@gmail.com>2021-07-08 18:02:09 +0200
commited2228209cffc4c51ac8adf6271d53f0908a0d50 (patch)
treeb22c794ccb284056b34f0e308581117c9432db1f
parent2968795f1a9ed64f99085f04e507f5417745c05a (diff)
Properly scale touch input window through resolution changes
The previous code would limit the touch window to the original resolution. Credit: https://stackoverflow.com/a/61284787 Change-Id: I6e93a00ac3009ab1c7b89135dacad302b020dc9f
-rw-r--r--services/inputflinger/reader/mapper/TouchInputMapper.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/services/inputflinger/reader/mapper/TouchInputMapper.cpp b/services/inputflinger/reader/mapper/TouchInputMapper.cpp
index 99a572a5fd..9a9e31b24a 100644
--- a/services/inputflinger/reader/mapper/TouchInputMapper.cpp
+++ b/services/inputflinger/reader/mapper/TouchInputMapper.cpp
@@ -3653,13 +3653,8 @@ void TouchInputMapper::rotateAndScale(float& x, float& y) {
}
bool TouchInputMapper::isPointInsideSurface(int32_t x, int32_t y) {
- const float xScaled = (x - mRawPointerAxes.x.minValue) * mXScale;
- const float yScaled = (y - mRawPointerAxes.y.minValue) * mYScale;
-
return x >= mRawPointerAxes.x.minValue && x <= mRawPointerAxes.x.maxValue &&
- xScaled >= mSurfaceLeft && xScaled <= mSurfaceRight &&
- y >= mRawPointerAxes.y.minValue && y <= mRawPointerAxes.y.maxValue &&
- yScaled >= mSurfaceTop && yScaled <= mSurfaceBottom;
+ y >= mRawPointerAxes.y.minValue && y <= mRawPointerAxes.y.maxValue;
}
const TouchInputMapper::VirtualKey* TouchInputMapper::findVirtualKeyHit(int32_t x, int32_t y) {