mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-01 22:10:10 +01:00
evdev: use fabs(x) instead of (x <= -a || x >= a)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
ffad279751
commit
697d25e9e2
1 changed files with 2 additions and 2 deletions
|
|
@ -1517,11 +1517,11 @@ evdev_post_scroll(struct evdev_device *device,
|
|||
double dx,
|
||||
double dy)
|
||||
{
|
||||
if (dy <= -device->scroll.threshold || dy >= device->scroll.threshold)
|
||||
if (fabs(dy) >= device->scroll.threshold)
|
||||
evdev_start_scrolling(device,
|
||||
LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
|
||||
|
||||
if (dx <= -device->scroll.threshold || dx >= device->scroll.threshold)
|
||||
if (fabs(dx) >= device->scroll.threshold)
|
||||
evdev_start_scrolling(device,
|
||||
LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue