Skip to content

Commit 0e8787d

Browse files
committed
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.
1 parent ab407e3 commit 0e8787d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

gtk2_ardour/editor_mouse.cc

+5
Original file line numberDiff line numberDiff line change
@@ -2338,6 +2338,11 @@ Editor::can_remove_control_point (ControlPoint& control_point)
23382338
if (line.is_last_point(control_point) || line.is_first_point(control_point)) {
23392339
return false;
23402340
}
2341+
} else {
2342+
/* we shouldn't remove the first automation point ... unless it also is the last */
2343+
if (line.is_first_point(control_point) && ! line.is_last_point(control_point)) {
2344+
return false;
2345+
}
23412346
}
23422347

23432348
return true;

0 commit comments

Comments
 (0)