mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-04-14 11:44:16 +00:00
Swap axes before applying touch screen calibration.
When the SwapAxes option is set, the X and Y axes in calibration should be labelled as the user perceives them -- not as the kernel sends them. Currently, we apply the X-axis calibration to the X-axis of the input, and then do the axis swapping so we've actually applied the X-axis calibration to what the user sees as the Y-axis. This patch changes the order of the operations, so that the axes are swapped before the calibration is applied. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
committed by
Peter Hutterer
parent
0e9d75ba68
commit
f187badb71
13
src/evdev.c
13
src/evdev.c
@@ -399,6 +399,13 @@ EvdevProcessValuators(InputInfoPtr pInfo, int v[MAX_VALUATORS], int *num_v,
|
||||
*/
|
||||
else if (pEvdev->abs && pEvdev->tool) {
|
||||
memcpy(v, pEvdev->vals, sizeof(int) * pEvdev->num_vals);
|
||||
|
||||
if (pEvdev->swap_axes) {
|
||||
int tmp = v[0];
|
||||
v[0] = v[1];
|
||||
v[1] = tmp;
|
||||
}
|
||||
|
||||
if (pEvdev->flags & EVDEV_CALIBRATED)
|
||||
{
|
||||
v[0] = xf86ScaleAxis(v[0],
|
||||
@@ -411,12 +418,6 @@ EvdevProcessValuators(InputInfoPtr pInfo, int v[MAX_VALUATORS], int *num_v,
|
||||
pEvdev->calibration.max_y, pEvdev->calibration.min_y);
|
||||
}
|
||||
|
||||
if (pEvdev->swap_axes) {
|
||||
int tmp = v[0];
|
||||
v[0] = v[1];
|
||||
v[1] = tmp;
|
||||
}
|
||||
|
||||
if (pEvdev->invert_x)
|
||||
v[0] = (pEvdev->absinfo[ABS_X].maximum - v[0] +
|
||||
pEvdev->absinfo[ABS_X].minimum);
|
||||
|
||||
Reference in New Issue
Block a user