mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-08 06:38:02 +02:00
tools: fix touch/abs event coordinate transformation in event-gui
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
3758f38bfd
commit
86d3628d55
1 changed files with 6 additions and 6 deletions
|
|
@ -242,11 +242,11 @@ static void
|
||||||
handle_event_absmotion(struct libinput_event *ev, struct window *w)
|
handle_event_absmotion(struct libinput_event *ev, struct window *w)
|
||||||
{
|
{
|
||||||
struct libinput_event_pointer *p = libinput_event_get_pointer_event(ev);
|
struct libinput_event_pointer *p = libinput_event_get_pointer_event(ev);
|
||||||
double x = libinput_event_pointer_get_absolute_x(p),
|
double x = libinput_event_pointer_get_absolute_x_transformed(p, w->width),
|
||||||
y = libinput_event_pointer_get_absolute_y(p);
|
y = libinput_event_pointer_get_absolute_y_transformed(p, w->height);
|
||||||
|
|
||||||
w->absx = clip((int)x, 0, w->width);
|
w->absx = x;
|
||||||
w->absy = clip((int)y, 0, w->height);
|
w->absy = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -267,8 +267,8 @@ handle_event_touch(struct libinput_event *ev, struct window *w)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
x = libinput_event_touch_get_x(t),
|
x = libinput_event_touch_get_x_transformed(t, w->width),
|
||||||
y = libinput_event_touch_get_y(t);
|
y = libinput_event_touch_get_y_transformed(t, w->height);
|
||||||
|
|
||||||
touch->active = 1;
|
touch->active = 1;
|
||||||
touch->x = (int)x;
|
touch->x = (int)x;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue