mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-09 13:20:24 +01:00
touchpad: Use TOUCHPAD_MIN_SAMPLES in tp_get_delta
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>
This commit is contained in:
parent
6664144611
commit
d21c8886c4
1 changed files with 2 additions and 4 deletions
|
|
@ -177,7 +177,7 @@ tp_estimate_delta(int x0, int x1, int x2, int x3)
|
|||
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;
|
||||
|
|
@ -602,9 +602,7 @@ tp_get_pointer_delta(struct tp_dispatch *tp, double *dx, double *dy)
|
|||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue