diff options
| author | 2021-08-18 21:06:56 +0000 | |
|---|---|---|
| committer | 2021-08-18 21:06:56 +0000 | |
| commit | 3f2d493099dd38e5abf6fb76f4a9e486ea9da8ba (patch) | |
| tree | c834128d316504bf3141230fba8a6ddb41b88642 | |
| parent | 059bc47a0bd49f90f5dff078b1d66d7b5fd71032 (diff) | |
| parent | f6814fa098c05eb7403f673955836595ee91e4f6 (diff) | |
Merge "Tilt scale correction for certain resolutions" am: 9365dde616 am: f6814fa098
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1753368
Change-Id: I0f3f0e4562c5d0b4d135cbfb9d37c9c1413f63a4
| -rw-r--r-- | services/inputflinger/reader/mapper/TouchInputMapper.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/services/inputflinger/reader/mapper/TouchInputMapper.cpp b/services/inputflinger/reader/mapper/TouchInputMapper.cpp index 962d8d2935..f45731527f 100644 --- a/services/inputflinger/reader/mapper/TouchInputMapper.cpp +++ b/services/inputflinger/reader/mapper/TouchInputMapper.cpp @@ -896,6 +896,13 @@ void TouchInputMapper::configureSurface(nsecs_t when, bool* outResetNeeded) { mTiltXScale = M_PI / 180; mTiltYScale = M_PI / 180; + if (mRawPointerAxes.tiltX.resolution) { + mTiltXScale = 1.0 / mRawPointerAxes.tiltX.resolution; + } + if (mRawPointerAxes.tiltY.resolution) { + mTiltYScale = 1.0 / mRawPointerAxes.tiltY.resolution; + } + mOrientedRanges.haveTilt = true; mOrientedRanges.tilt.axis = AMOTION_EVENT_AXIS_TILT; |