mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-29 07:50:08 +01:00
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>
This commit is contained in:
parent
d4d2abe971
commit
f877ff2f96
1 changed files with 4 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue