[PATCH libinput 3/3] filter: add a comment for how we calculate velocity
Peter Hutterer
peter.hutterer at who-t.net
Wed Dec 14 07:36:18 UTC 2016
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
src/filter.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/filter.c b/src/filter.c
index a7cb545..77652a2 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -228,6 +228,13 @@ calculate_velocity_after_timeout(struct pointer_tracker *tracker)
tracker->time + MOTION_TIMEOUT);
}
+/**
+ * Calculate the velocity based on the tracker data. Velocity is averaged
+ * across multiple historical values, provided those values aren't "too
+ * different" to our current one. That includes either being too far in the
+ * past, moving into a different direction or having too much of a velocity
+ * change between events.
+ */
static double
calculate_velocity(struct pointer_accelerator *accel, uint64_t time)
{
--
2.9.3
More information about the wayland-devel
mailing list