Remove drag code from automation region view.
Let the editor handle it like (almost) everything else.
This commit is contained in:
parent
d39d4c1c11
commit
59bb3fbe65
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user