diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-02-16 14:07:30 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-02-16 14:08:12 +1000 |
commit | 978384ede7b0832fef8a399efbc3050bb2f212f7 (patch) | |
tree | 57a2490cba7624065fb4af488ac2b04413ee267a | |
parent | CacheCompare before probing the device. (diff) | |
download | xf86-input-evdev-978384ede7b0832fef8a399efbc3050bb2f212f7.tar.gz xf86-input-evdev-978384ede7b0832fef8a399efbc3050bb2f212f7.tar.bz2 xf86-input-evdev-978384ede7b0832fef8a399efbc3050bb2f212f7.zip |
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>
-rw-r--r-- | src/evdev.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/evdev.c b/src/evdev.c index 05c6cec..a62ebe7 100644 --- a/src/evdev.c +++ b/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); |