From 34e3945249cc2b9c25e1f93561cd71f5a141aa74 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Thu, 19 May 2016 17:23:28 +0200 Subject: [PATCH] bugfix - one needs to translate to local coordinates --- common/utils/T/tracer/gui/timeline.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/common/utils/T/tracer/gui/timeline.c b/common/utils/T/tracer/gui/timeline.c index 2f1e6121f4..d2373ff60a 100644 --- a/common/utils/T/tracer/gui/timeline.c +++ b/common/utils/T/tracer/gui/timeline.c @@ -58,19 +58,20 @@ static void button(gui *_g, widget *_this, int x, int y, int key_modifiers, int button, int up) { struct gui *g = _g; + struct timeline_widget *w = _this; int d[3]; LOGD("BUTTON timeline %p xy %d %d button %d up %d\n", _this, x, y, button, up); /* scroll up */ if (button == 4 && up == 0) { - d[0] = x; - d[1] = y; + d[0] = x - w->common.x; + d[1] = y - w->common.y; d[2] = key_modifiers; gui_notify(g, "scrollup", _this, d); } /* scroll down */ if (button == 5 && up == 0) { - d[0] = x; - d[1] = y; + d[0] = x - w->common.x; + d[1] = y - w->common.y; d[2] = key_modifiers; gui_notify(g, "scrolldown", _this, d); } -- GitLab