Fix touch input in landscape mode.
Change-Id: I7d47e9b02e6443ed604a6bf842028a5db934d90d
This commit is contained in:
@@ -1600,7 +1600,7 @@ void TouchInputMapper::dispatchTouch(nsecs_t when, uint32_t policyFlags,
|
|||||||
case InputReaderPolicyInterface::ROTATION_90: {
|
case InputReaderPolicyInterface::ROTATION_90: {
|
||||||
float xTemp = x;
|
float xTemp = x;
|
||||||
x = y;
|
x = y;
|
||||||
y = mOrientedSurfaceWidth - xTemp;
|
y = mSurfaceWidth - xTemp;
|
||||||
orientation -= M_PI_2;
|
orientation -= M_PI_2;
|
||||||
if (orientation < - M_PI_2) {
|
if (orientation < - M_PI_2) {
|
||||||
orientation += M_PI;
|
orientation += M_PI;
|
||||||
@@ -1608,14 +1608,14 @@ void TouchInputMapper::dispatchTouch(nsecs_t when, uint32_t policyFlags,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case InputReaderPolicyInterface::ROTATION_180: {
|
case InputReaderPolicyInterface::ROTATION_180: {
|
||||||
x = mOrientedSurfaceWidth - x;
|
x = mSurfaceWidth - x;
|
||||||
y = mOrientedSurfaceHeight - y;
|
y = mSurfaceHeight - y;
|
||||||
orientation = - orientation;
|
orientation = - orientation;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case InputReaderPolicyInterface::ROTATION_270: {
|
case InputReaderPolicyInterface::ROTATION_270: {
|
||||||
float xTemp = x;
|
float xTemp = x;
|
||||||
x = mOrientedSurfaceHeight - y;
|
x = mSurfaceHeight - y;
|
||||||
y = xTemp;
|
y = xTemp;
|
||||||
orientation += M_PI_2;
|
orientation += M_PI_2;
|
||||||
if (orientation > M_PI_2) {
|
if (orientation > M_PI_2) {
|
||||||
|
|||||||
Reference in New Issue
Block a user