AutomationLine::show ()
{
if (_visible & Line) {
- if (alist->interpolation() != AutomationList::Discrete) {
+ /* Only show the line there are some points, otherwise we may show an out-of-date line
+ when automation points have been removed (the line will still follow the shape of the
+ old points).
+ */
+ if (alist->interpolation() != AutomationList::Discrete && control_points.size() >= 2) {
line->show();
} else {
line->hide ();
y = min (1.0, y);
y = _height - (y * _height);
- double const x = trackview.editor().frame_to_unit (_time_converter->to((*cp.model())->when) - _offset);
+ double const x = trackview.editor().frame_to_unit_unrounded (_time_converter->to((*cp.model())->when) - _offset);
trackview.editor().session()->begin_reversible_command (_("automation event move"));
trackview.editor().session()->add_command (
}
_drag_had_movement = true;
- did_push = with_push;
+ if (with_push) {
+ did_push = with_push;
+ }
return clamped;
}
/* if xval has not changed, set it directly from the model to avoid rounding errors */
- if (view_x == trackview.editor().frame_to_unit (_time_converter->to ((*cp.model())->when)) - _offset) {
+ if (view_x == trackview.editor().frame_to_unit_unrounded (_time_converter->to ((*cp.model())->when)) - _offset) {
view_x = (*cp.model())->when - _offset;
} else {
view_x = trackview.editor().unit_to_frame (view_x);
view_to_model_coord_y (view_y);
alist->modify (cp.model(), view_x, view_y);
-
- if (did_push) {
- /* move all points after cp by the same distance */
- alist->slide (cp.model()++, _time_converter->from (distance));
- }
}
bool
ControlPoint *acp = 0;
double unit_xval;
- unit_xval = trackview.editor().frame_to_unit (xval);
+ unit_xval = trackview.editor().frame_to_unit_unrounded (xval);
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
* zoom and scroll into account).
*/
- tx = trackview.editor().frame_to_unit (tx);
+ tx = trackview.editor().frame_to_unit_unrounded (tx);
/* convert from canonical view height (0..1.0) to actual
* height coordinates (using X11's top-left rooted system)