summaryrefslogtreecommitdiffstats
path: root/services/input/InputReader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'services/input/InputReader.cpp')
-rw-r--r--services/input/InputReader.cpp12
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: