summaryrefslogtreecommitdiff
path: root/tools/event-gui.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2014-07-03 09:57:12 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2014-07-03 09:59:22 +1000
commit86d3628d55cd9632e887640079f57daeff6b0dfb (patch)
treea3343634a56a456acbf92ac34fbdcab80d75abde /tools/event-gui.c
parent3758f38bfda6be47da940a11e2c4cf862f9bf6e4 (diff)
tools: fix touch/abs event coordinate transformation in event-gui
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools/event-gui.c')
-rw-r--r--tools/event-gui.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/event-gui.c b/tools/event-gui.c
index 78a61672..0aa91298 100644
--- a/tools/event-gui.c
+++ b/tools/event-gui.c
@@ -242,11 +242,11 @@ static void
handle_event_absmotion(struct libinput_event *ev, struct window *w)
{
struct libinput_event_pointer *p = libinput_event_get_pointer_event(ev);
- double x = libinput_event_pointer_get_absolute_x(p),
- y = libinput_event_pointer_get_absolute_y(p);
+ double x = libinput_event_pointer_get_absolute_x_transformed(p, w->width),
+ y = libinput_event_pointer_get_absolute_y_transformed(p, w->height);
- w->absx = clip((int)x, 0, w->width);
- w->absy = clip((int)y, 0, w->height);
+ w->absx = x;
+ w->absy = y;
}
static void
@@ -267,8 +267,8 @@ handle_event_touch(struct libinput_event *ev, struct window *w)
return;
}
- x = libinput_event_touch_get_x(t),
- y = libinput_event_touch_get_y(t);
+ x = libinput_event_touch_get_x_transformed(t, w->width),
+ y = libinput_event_touch_get_y_transformed(t, w->height);
touch->active = 1;
touch->x = (int)x;