* commit 'c8c82009dc8c146efadac6b51702922148f6003f': Properly rotate full [-pi, +pi] orientation range if available
This commit is contained in:
@@ -4252,8 +4252,8 @@ 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 < - M_PI_2) {
|
||||
orientation += M_PI;
|
||||
if (orientation < mOrientedRanges.orientation.min) {
|
||||
orientation += (mOrientedRanges.orientation.max - mOrientedRanges.orientation.min);
|
||||
}
|
||||
break;
|
||||
case DISPLAY_ORIENTATION_180:
|
||||
@@ -4263,6 +4263,10 @@ void TouchInputMapper::cookPointerData() {
|
||||
right = float(mRawPointerAxes.x.maxValue - rawLeft) * mXScale + mXTranslate;
|
||||
bottom = float(mRawPointerAxes.y.maxValue - rawTop) * mYScale + mYTranslate;
|
||||
top = float(mRawPointerAxes.y.maxValue - rawBottom) * 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;
|
||||
@@ -4272,8 +4276,8 @@ 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 > M_PI_2) {
|
||||
orientation -= M_PI;
|
||||
if (orientation > mOrientedRanges.orientation.max) {
|
||||
orientation -= (mOrientedRanges.orientation.max - mOrientedRanges.orientation.min);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user