diff options
author | Jeff Brown <jeffbrown@android.com> | 2013-05-28 19:56:19 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-05-28 19:56:20 +0000 |
commit | 7573e5947a643dd8b8a97ee9dbf1dab398ad4ea7 (patch) | |
tree | 77565ed6f06cf867d4472542072950cc2b75a9db /services | |
parent | e2a281ca85f17eaf6d47978c76d2cafb0fa81782 (diff) | |
parent | 70bca4cc8a37c34ec5cdb0405b2e7e2c2779630d (diff) | |
download | frameworks_base-7573e5947a643dd8b8a97ee9dbf1dab398ad4ea7.zip frameworks_base-7573e5947a643dd8b8a97ee9dbf1dab398ad4ea7.tar.gz frameworks_base-7573e5947a643dd8b8a97ee9dbf1dab398ad4ea7.tar.bz2 |
Merge "Properly rotate full [-pi, +pi] orientation range if available"
Diffstat (limited to 'services')
-rw-r--r-- | services/input/InputReader.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/services/input/InputReader.cpp b/services/input/InputReader.cpp index bc8df18..e41cce2 100644 --- a/services/input/InputReader.cpp +++ b/services/input/InputReader.cpp @@ -4170,20 +4170,24 @@ void TouchInputMapper::cookPointerData() { x = float(in.y - mRawPointerAxes.y.minValue) * mYScale + mYTranslate; y = float(mRawPointerAxes.x.maxValue - in.x) * mXScale + mXTranslate; orientation -= M_PI_2; - if (orientation < - M_PI_2) { - orientation += M_PI; + if (orientation < mOrientedRanges.orientation.min) { + orientation += (mOrientedRanges.orientation.max - mOrientedRanges.orientation.min); } break; case DISPLAY_ORIENTATION_180: x = float(mRawPointerAxes.x.maxValue - in.x) * mXScale + mXTranslate; y = float(mRawPointerAxes.y.maxValue - in.y) * mYScale + mYTranslate; + orientation -= M_PI; + if (orientation < mOrientedRanges.orientation.min) { + orientation += (mOrientedRanges.orientation.max - mOrientedRanges.orientation.min); + } break; case DISPLAY_ORIENTATION_270: x = float(mRawPointerAxes.y.maxValue - in.y) * mYScale + mYTranslate; y = float(in.x - mRawPointerAxes.x.minValue) * mXScale + mXTranslate; orientation += M_PI_2; - if (orientation > M_PI_2) { - orientation -= M_PI; + if (orientation > mOrientedRanges.orientation.max) { + orientation -= (mOrientedRanges.orientation.max - mOrientedRanges.orientation.min); } break; default: |