diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2014-06-23 23:32:29 +0200 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2014-06-23 23:36:48 +0200 |
commit | 86c5fba0d294fba1d09224b48ff1ead9a5d5dad5 (patch) | |
tree | 063910e769eec574da7167c844abc22db4e1c982 /tools | |
parent | 82e81e8790956cb531c9ae5a225e4425b40a1f50 (diff) |
event-gui: Don't drop fraction of pointer motion events
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/event-gui.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/event-gui.c b/tools/event-gui.c index 95540936..e080ea86 100644 --- a/tools/event-gui.c +++ b/tools/event-gui.c @@ -53,7 +53,7 @@ struct window { int width, height; /* of window */ /* sprite position */ - int x, y; + double x, y; /* abs position */ int absx, absy; @@ -233,10 +233,10 @@ handle_event_motion(struct libinput_event *ev, struct window *w) double dx = libinput_event_pointer_get_dx(p), dy = libinput_event_pointer_get_dy(p); - w->x += (int)dx; - w->y += (int)dy; - w->x = clip(w->x, 0, w->width); - w->y = clip(w->y, 0, w->height); + w->x += dx; + w->y += dy; + w->x = clip(w->x, 0.0, w->width); + w->y = clip(w->y, 0.0, w->height); } static void |