mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-03-21 22:40:42 +01:00
event-gui: Don't drop fraction of pointer motion events
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
This commit is contained in:
parent
82e81e8790
commit
86c5fba0d2
1 changed files with 5 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue