Use TOUCHPAD_MIN_SAMPLES in tp_get_delta rather then hardcoding "4".
Also remove the superfluous TOUCHPAD_MIN_SAMPLES check before calling
tp_get_delta in tp_get_pointer_delta, this is not necessary as tp_get_delta
already checks itself.
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>
void
tp_get_delta(struct tp_touch *t, double *dx, double *dy)
{
- if (t->history.count < 4) {
+ if (t->history.count < TOUCHPAD_MIN_SAMPLES) {
*dx = 0;
*dy = 0;
return;
}
}
- if (!t->is_pointer ||
- !t->dirty ||
- t->history.count < TOUCHPAD_MIN_SAMPLES)
+ if (!t->is_pointer || !t->dirty)
return;
tp_get_delta(t, dx, dy);