diff options
author | Michael Wright <michaelwr@google.com> | 2015-04-27 14:13:21 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-04-27 14:13:22 +0000 |
commit | 7ecc8952c47009bca8d286d374a978bd305247d5 (patch) | |
tree | df0d2d85242b6a4b1238d24d1e488fe13ddfb830 /services | |
parent | 958f501189a29e53767f41bc8172e4af8d1ce2bf (diff) | |
parent | 18a81488f928a94bdeede9b884f9b56c8da0c5fc (diff) | |
download | frameworks_native-7ecc8952c47009bca8d286d374a978bd305247d5.zip frameworks_native-7ecc8952c47009bca8d286d374a978bd305247d5.tar.gz frameworks_native-7ecc8952c47009bca8d286d374a978bd305247d5.tar.bz2 |
Merge "Check orientation range has been initialized first"
Diffstat (limited to 'services')
-rw-r--r-- | services/inputflinger/InputReader.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/services/inputflinger/InputReader.cpp b/services/inputflinger/InputReader.cpp index 8634e42..318c85f 100644 --- a/services/inputflinger/InputReader.cpp +++ b/services/inputflinger/InputReader.cpp @@ -4315,7 +4315,7 @@ void TouchInputMapper::cookPointerData() { bottom = float(mRawPointerAxes.x.maxValue - rawLeft) * mXScale + mXTranslate; top = float(mRawPointerAxes.x.maxValue - rawRight) * mXScale + mXTranslate; orientation -= M_PI_2; - if (orientation < mOrientedRanges.orientation.min) { + if (mOrientedRanges.haveOrientation && orientation < mOrientedRanges.orientation.min) { orientation += (mOrientedRanges.orientation.max - mOrientedRanges.orientation.min); } break; @@ -4327,7 +4327,7 @@ void TouchInputMapper::cookPointerData() { bottom = float(mRawPointerAxes.y.maxValue - rawTop) * mYScale + mYTranslate; top = float(mRawPointerAxes.y.maxValue - rawBottom) * mYScale + mYTranslate; orientation -= M_PI; - if (orientation < mOrientedRanges.orientation.min) { + if (mOrientedRanges.haveOrientation && orientation < mOrientedRanges.orientation.min) { orientation += (mOrientedRanges.orientation.max - mOrientedRanges.orientation.min); } break; @@ -4339,7 +4339,7 @@ void TouchInputMapper::cookPointerData() { bottom = float(rawRight - mRawPointerAxes.x.minValue) * mXScale + mXTranslate; top = float(rawLeft - mRawPointerAxes.x.minValue) * mXScale + mXTranslate; orientation += M_PI_2; - if (orientation > mOrientedRanges.orientation.max) { + if (mOrientedRanges.haveOrientation && orientation > mOrientedRanges.orientation.max) { orientation -= (mOrientedRanges.orientation.max - mOrientedRanges.orientation.min); } break; |