diff options
author | David Woodhouse <dwmw2@infradead.org> | 2009-12-01 00:12:36 +0000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-12-01 14:12:49 +1000 |
commit | f187badb71554a73bf9ca30ce75c9d166e688f03 (patch) | |
tree | ff6f43d912309d23f92ce8d4a650fb8d21ac0f96 | |
parent | Fix a comment, EV_CNT is available since 2.6.24 (diff) | |
download | xf86-input-evdev-f187badb71554a73bf9ca30ce75c9d166e688f03.tar.gz xf86-input-evdev-f187badb71554a73bf9ca30ce75c9d166e688f03.tar.bz2 xf86-input-evdev-f187badb71554a73bf9ca30ce75c9d166e688f03.zip |
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>
-rw-r--r-- | src/evdev.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/evdev.c b/src/evdev.c index 81a0bd5..f4b2b2e 100644 --- a/src/evdev.c +++ b/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); |