mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-03-24 09:44:28 +00:00
Swap axes after scaling, not before.
If we swap before scaling, we scale with the wrong coordinate range. Reported by Matt Helsley. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
12
src/evdev.c
12
src/evdev.c
@@ -490,12 +490,6 @@ EvdevReadInput(InputInfoPtr pInfo)
|
||||
int v[MAX_VALUATORS];
|
||||
|
||||
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],
|
||||
@@ -508,6 +502,12 @@ EvdevReadInput(InputInfoPtr pInfo)
|
||||
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