summaryrefslogtreecommitdiff
path: root/tools/event-gui.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2015-04-22 15:31:21 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2015-04-22 15:31:21 +1000
commitf877ff2f96e79c8572949a7e8ba0f165300880e6 (patch)
tree6eee0782f52d394ccd292a1dc8fd515d0e94d40e /tools/event-gui.c
parentd4d2abe97110dadc2a45caea6c39a44cf0fb0bde (diff)
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 <peter.hutterer@who-t.net>
Diffstat (limited to 'tools/event-gui.c')
-rw-r--r--tools/event-gui.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/event-gui.c b/tools/event-gui.c
index 3ce7418..678e75b 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);
}
}