summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-07-18 11:06:39 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2014-07-21 20:20:49 +1000
commitaab902cc396f6f6e43cc2a90409992017e974c44 (patch)
tree67b99191d672f1ee3498ea77f59d02256e087089
parent64f431c303fab787eaf8a7cb14752d908b3da8b2 (diff)
downloadlibinput-aab902cc396f6f6e43cc2a90409992017e974c44.tar.gz
touchpad: make tp_estimate_delta return fractions
Force a cast of the input arguments to a double before the divide, rather than after the divide. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/evdev-mt-touchpad.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 4d4856f6..b0520c79 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -163,7 +163,7 @@ tp_end_touch(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time)
static double
tp_estimate_delta(int x0, int x1, int x2, int x3)
{
- return (x0 + x1 - x2 - x3) / 4;
+ return (x0 + x1 - x2 - x3) / 4.0;
}
void