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
This commit is contained in:
Carl Hetherington
2011-12-31 13:25:56 +00:00
parent 6c0224c987
commit 084fc8b327

View File

@@ -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 */