From 0e8787d23373f09f8195b574f7222f5c5e81611e Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Mon, 24 Oct 2022 17:08:54 +0200 Subject: [PATCH] Don't allow deletion of the first control point in automation lines It seems to be an invariant that automation lines always have an "anchor" control point at time zero. That control point is set when the first real control point is set. It thus seems like it shouldn't be possible to remove it unless the whole control set is being cleared.. However: If it really is an important invariant, it should be enforced at a lower level. And it is also possible to drag the anchor away from time zero, thus raising the question of when it is an anchor and why it is needed. It seems like automation generally works fine without these anchors. --- gtk2_ardour/editor_mouse.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 1dd525c14ee..c43fb873abf 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -2338,6 +2338,11 @@ Editor::can_remove_control_point (ControlPoint& control_point) if (line.is_last_point(control_point) || line.is_first_point(control_point)) { return false; } + } else { + /* we shouldn't remove the first automation point ... unless it also is the last */ + if (line.is_first_point(control_point) && ! line.is_last_point(control_point)) { + return false; + } } return true;