13
0

Remove drag code from automation region view.

Let the editor handle it like (almost) everything else.
This commit is contained in:
David Robillard 2015-01-13 23:53:28 -05:00
parent d39d4c1c11
commit 59bb3fbe65
2 changed files with 12 additions and 24 deletions

View File

@ -132,30 +132,10 @@ AutomationRegionView::canvas_group_event (GdkEvent* ev)
PublicEditor& e = trackview.editor ();
if (!trackview.editor().internal_editing()) {
// not in internal edit mode, so just act like a normal region
return RegionView::canvas_group_event (ev);
}
if (ev->type == GDK_BUTTON_PRESS && e.current_mouse_mode() == Editing::MouseContent) {
/* XXX: icky dcast to Editor */
e.drags()->set (new EditorRubberbandSelectDrag (dynamic_cast<Editor*> (&e), group), ev);
e.drags()->start_grab (ev);
return true;
} else if (ev->type == GDK_MOTION_NOTIFY && e.drags()->active()) {
/* we probably shouldn't have to handle this here, but... */
e.drags()->motion_handler(ev, false);
return true;
} else if (ev->type == GDK_BUTTON_RELEASE && e.current_mouse_mode() == Editing::MouseDraw) {
if (e.drags()->end_grab (ev)) {
return true;
} else if (e.current_mouse_mode() != Editing::MouseDraw &&
e.current_mouse_mode() != Editing::MouseContent) {
return RegionView::canvas_group_event (ev);
}
if (trackview.editor().internal_editing() &&
ev->type == GDK_BUTTON_RELEASE &&
e.current_mouse_mode() == Editing::MouseDraw &&
!e.drags()->active()) {
double x = ev->button.x;
double y = ev->button.y;

View File

@ -750,6 +750,14 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
return true;
break;
case RegionItem:
if (dynamic_cast<AutomationRegionView*>(clicked_regionview)) {
/* rubberband drag to select automation points */
_drags->set (new EditorRubberbandSelectDrag (this, item), event);
return true;
}
break;
default:
break;
}