From 79339bca9c0f2884e679aeba94f0db65692fe652 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 18 Jan 2017 17:22:30 +1000 Subject: [PATCH] filter: change the tracker delta type to device-units We were just switching type here without actual normalization, the filter code is in device units as of bdd4264d6150f4a6248eec7. Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede --- src/filter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/filter.c b/src/filter.c index d7a15158..30352340 100644 --- a/src/filter.c +++ b/src/filter.c @@ -156,7 +156,7 @@ filter_get_type(struct motion_filter *filter) #define NUM_POINTER_TRACKERS 16 struct pointer_tracker { - struct normalized_coords delta; /* delta to most recent event */ + struct device_float_coords delta; /* delta to most recent event */ uint64_t time; /* us */ uint32_t dir; }; @@ -230,7 +230,7 @@ static double calculate_tracker_velocity(struct pointer_tracker *tracker, uint64_t time) { double tdelta = time - tracker->time + 1; - return normalized_length(tracker->delta) / tdelta; /* units/us */ + return hypot(tracker->delta.x, tracker->delta.y) / tdelta; /* units/us */ } static inline double -- 2.34.1