mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-09 05:58:01 +02:00
evdev: Use temporary x and y coordinates when applying calibration
Don't overwrite device->abs.x halfway through the matrix multiplication.
This commit is contained in:
parent
95e1abf104
commit
7ff70db86d
1 changed files with 11 additions and 6 deletions
17
src/evdev.c
17
src/evdev.c
|
|
@ -230,16 +230,21 @@ is_motion_event(struct input_event *e)
|
||||||
static void
|
static void
|
||||||
transform_absolute(struct evdev_device *device)
|
transform_absolute(struct evdev_device *device)
|
||||||
{
|
{
|
||||||
|
int32_t x, y;
|
||||||
|
|
||||||
if (!device->abs.apply_calibration)
|
if (!device->abs.apply_calibration)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
device->abs.x = device->abs.x * device->abs.calibration[0] +
|
x = device->abs.x * device->abs.calibration[0] +
|
||||||
device->abs.y * device->abs.calibration[1] +
|
device->abs.y * device->abs.calibration[1] +
|
||||||
device->abs.calibration[2];
|
device->abs.calibration[2];
|
||||||
|
|
||||||
device->abs.y = device->abs.x * device->abs.calibration[3] +
|
y = device->abs.x * device->abs.calibration[3] +
|
||||||
device->abs.y * device->abs.calibration[4] +
|
device->abs.y * device->abs.calibration[4] +
|
||||||
device->abs.calibration[5];
|
device->abs.calibration[5];
|
||||||
|
|
||||||
|
device->abs.x = x;
|
||||||
|
device->abs.y = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue