Skip to content

Commit

Permalink
Don't allow deletion of the first control point in automation lines
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kiilerix committed Oct 26, 2022
1 parent ab407e3 commit 0e8787d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gtk2_ardour/editor_mouse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0e8787d

Please sign in to comment.