From: Kristian Høgsberg Date: Fri, 26 Jul 2013 17:41:43 +0000 (-0700) Subject: evdev: Use temporary x and y coordinates when applying calibration X-Git-Tag: 1.2.91~199 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=58014bbba84e207b9ca8afd98b20e3f1ffc06b33;p=platform%2Fupstream%2Fweston.git evdev: Use temporary x and y coordinates when applying calibration Don't overwrite device->abs.x halfway through the matrix multiplication. --- diff --git a/src/evdev.c b/src/evdev.c index a554302..dd3e2c9 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -230,16 +230,21 @@ is_motion_event(struct input_event *e) static void transform_absolute(struct evdev_device *device) { + int32_t x, y; + if (!device->abs.apply_calibration) return; - device->abs.x = device->abs.x * device->abs.calibration[0] + - device->abs.y * device->abs.calibration[1] + - device->abs.calibration[2]; + x = device->abs.x * device->abs.calibration[0] + + device->abs.y * device->abs.calibration[1] + + device->abs.calibration[2]; + + y = device->abs.x * device->abs.calibration[3] + + device->abs.y * device->abs.calibration[4] + + device->abs.calibration[5]; - device->abs.y = device->abs.x * device->abs.calibration[3] + - device->abs.y * device->abs.calibration[4] + - device->abs.calibration[5]; + device->abs.x = x; + device->abs.y = y; } static void