diff options
author | Carl Hetherington <carl@carlh.net> | 2011-12-31 13:25:56 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-12-31 13:25:56 +0000 |
commit | 084fc8b3273d6daeb299773811c7d2bd0e1d5598 (patch) | |
tree | ab63e3aea90a8a203446c2228e220ee61e8c9668 /gtk2_ardour | |
parent | 6c0224c9876b1c1c55c6d5f98d82d5d0a870378f (diff) |
Slightly improve proxying of events by crossfade views; doesn't really have any positive effect, unfortunately.
git-svn-id: svn://localhost/ardour2/branches/3.0@11127 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor_canvas_events.cc | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/gtk2_ardour/editor_canvas_events.cc b/gtk2_ardour/editor_canvas_events.cc index 07ae84031f..215cea3470 100644 --- a/gtk2_ardour/editor_canvas_events.cc +++ b/gtk2_ardour/editor_canvas_events.cc @@ -554,6 +554,8 @@ Editor::canvas_crossfade_view_event (GdkEvent* event, ArdourCanvas::Item* item, /* XXX really need to check if we are in the name highlight, and proxy to that when required. + + XXX or in the trim rectangles */ TimeAxisView& tv (xfv->get_time_axis_view()); @@ -587,13 +589,30 @@ Editor::canvas_crossfade_view_event (GdkEvent* event, ArdourCanvas::Item* item, /* we're in stacked mode; proxy to the region view under the mouse */ - /* XXX: FIXME: this is an evil hack; it assumes that any event for which - this proxy is being used has its GdkEvent laid out such that the y - member is in the same place as that for a GdkEventButton */ + double cx = 0; + double cy = 0; + switch (event->type) { + case GDK_BUTTON_PRESS: + case GDK_BUTTON_RELEASE: + cx = event->button.x; + cy = event->button.y; + break; + case GDK_MOTION_NOTIFY: + cx = event->motion.x; + cy = event->motion.y; + break; + case GDK_ENTER_NOTIFY: + case GDK_LEAVE_NOTIFY: + cx = event->crossing.x; + cy = event->crossing.y; + break; + default: + /* XXX: this may be wrong for some events */ + cx = event->button.x; + cy = event->button.y; + } /* position of the event within the track */ - double cx = event->button.x; - double cy = event->button.y; atv->view()->canvas_item()->w2i (cx, cy); /* hence layer that we're over */ |