Remove unused header include
[ardour.git] / gtk2_ardour / automation_line.cc
index d7b3f3e68d19df1bc14b3ffa8fa062a0beaa309f..f5d2669d0ab9b48f016fa1aef24c8744db74ed0e 100644 (file)
@@ -136,7 +136,11 @@ void
 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 ();
@@ -558,7 +562,9 @@ AutomationLine::drag_motion (double const x, float fraction, bool ignore_x, bool
        }
 
        _drag_had_movement = true;
-       did_push = with_push;
+       if (with_push) {
+               did_push = with_push;
+       }
 
        return clamped;
 }
@@ -619,11 +625,6 @@ AutomationLine::sync_model_with_view_point (ControlPoint& cp, framecnt_t distanc
        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