bugfix - one needs to translate to local coordinates
This commit is contained in:
@@ -58,19 +58,20 @@ static void button(gui *_g, widget *_this, int x, int y,
|
|||||||
int key_modifiers, int button, int up)
|
int key_modifiers, int button, int up)
|
||||||
{
|
{
|
||||||
struct gui *g = _g;
|
struct gui *g = _g;
|
||||||
|
struct timeline_widget *w = _this;
|
||||||
int d[3];
|
int d[3];
|
||||||
LOGD("BUTTON timeline %p xy %d %d button %d up %d\n", _this, x, y, button, up);
|
LOGD("BUTTON timeline %p xy %d %d button %d up %d\n", _this, x, y, button, up);
|
||||||
/* scroll up */
|
/* scroll up */
|
||||||
if (button == 4 && up == 0) {
|
if (button == 4 && up == 0) {
|
||||||
d[0] = x;
|
d[0] = x - w->common.x;
|
||||||
d[1] = y;
|
d[1] = y - w->common.y;
|
||||||
d[2] = key_modifiers;
|
d[2] = key_modifiers;
|
||||||
gui_notify(g, "scrollup", _this, d);
|
gui_notify(g, "scrollup", _this, d);
|
||||||
}
|
}
|
||||||
/* scroll down */
|
/* scroll down */
|
||||||
if (button == 5 && up == 0) {
|
if (button == 5 && up == 0) {
|
||||||
d[0] = x;
|
d[0] = x - w->common.x;
|
||||||
d[1] = y;
|
d[1] = y - w->common.y;
|
||||||
d[2] = key_modifiers;
|
d[2] = key_modifiers;
|
||||||
gui_notify(g, "scrolldown", _this, d);
|
gui_notify(g, "scrolldown", _this, d);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user