From 201b9574a207abded6a58b8b05bef2f761f058cd Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 26 Sep 2023 17:03:09 +0200 Subject: [PATCH] In Draw mode, do not allow to grab lines. see also 3cf122742175 and c578695a64 --- gtk2_ardour/automation_line.cc | 1 + gtk2_ardour/editor_mouse.cc | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index f13e38cbef..adc61813e4 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -112,6 +112,7 @@ AutomationLine::AutomationLine (const string& name, line = new ArdourCanvas::PolyLine (group); CANVAS_DEBUG_NAME (line, "region gain envelope line"); line->set_data ("line", this); + line->set_data ("trackview", &trackview); line->set_outline_width (2.0); line->set_covers_threshold (4.0); diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 653e70245d..bda241b2ec 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -689,7 +689,7 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it break; case AutomationLineItem: - if (eff_mouse_mode != MouseRange) { + if (eff_mouse_mode != MouseRange && eff_mouse_mode != MouseDraw) { AutomationLine* al = reinterpret_cast (item->get_data ("line")); std::list selectables; double mx = event->button.x; @@ -1356,6 +1356,8 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT break; } + case AutomationLineItem: + /* fallthrough */ case AutomationTrackItem: { AutomationTimeAxisView* atv = static_cast (item->get_data ("trackview")); @@ -1365,10 +1367,6 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT } break; - case AutomationLineItem: - _drags->set (new LineDrag (this, item), event); - break; - case NoteItem: if ((note = reinterpret_cast(item->get_data ("notebase")))) { if (note->big_enough_to_trim() && note->mouse_near_ends()) {