[PATCH 4/4] touchpad: make tp_estimate_delta return fractions
Hans de Goede
hdegoede at redhat.com
Fri Jul 18 02:06:39 PDT 2014
Force a cast of the input arguments to a double before the divide, rather
then after the divide.
Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
src/evdev-mt-touchpad.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 1e2f58d..b88fa80 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
--
2.0.1
More information about the wayland-devel
mailing list