From f877ff2f96e79c8572949a7e8ba0f165300880e6 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 22 Apr 2015 15:31:21 +1000 Subject: [PATCH] tools: use doubles to back the scroll bars Slow scrolling otherwise won't move them because we keep truncating the subpixels. Signed-off-by: Peter Hutterer --- tools/event-gui.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/event-gui.c b/tools/event-gui.c index 3ce74183..678e75bc 100644 --- a/tools/event-gui.c +++ b/tools/event-gui.c @@ -62,8 +62,8 @@ struct window { int absx, absy; /* scroll bar positions */ - int vx, vy; - int hx, hy; + double vx, vy; + double hx, hy; /* touch positions */ struct touch touches[32]; @@ -363,7 +363,7 @@ handle_event_axis(struct libinput_event *ev, struct window *w) LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL)) { value = libinput_event_pointer_get_axis_value(p, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL); - w->vy += (int)value; + w->vy += value; w->vy = clip(w->vy, 0, w->height); } @@ -371,7 +371,7 @@ handle_event_axis(struct libinput_event *ev, struct window *w) LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL)) { value = libinput_event_pointer_get_axis_value(p, LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL); - w->hx += (int)value; + w->hx += value; w->hx = clip(w->hx, 0, w->width); } }