VU meter label color&shadow tweak by the_CLA
[ardour.git] / gtk2_ardour / automation_line.cc
index 63b9740c00a8260ae4a555b4782b5051111e9025..7e60bff2e34ffc0c98a125780eef574dea03776b 100644 (file)
@@ -507,15 +507,22 @@ AutomationLine::ContiguousControlPoints::ContiguousControlPoints (AutomationLine
 void
 AutomationLine::ContiguousControlPoints::compute_x_bounds ()
 {
-       if (!empty()) {
+       uint32_t sz = size();
+
+       if (sz > 0 && sz < line.npoints()) {
+
                /* determine the limits on x-axis motion for this 
                   contiguous range of control points
                */
-               
+
                if (front()->view_index() > 0) {
                        before_x = line.nth (front()->view_index() - 1)->get_x();
                }
-               
+
+               /* if our last point has a point after it in the line,
+                  we have an "after" bound
+               */
+
                if (back()->view_index() < (line.npoints() - 2)) {
                        after_x = line.nth (back()->view_index() + 1)->get_x();
                }
@@ -674,8 +681,10 @@ AutomationLine::drag_motion (double const x, float fraction, bool ignore_x, bool
 
                /* update actual line coordinates (will queue a redraw)
                 */
-               
-               line->property_points() = line_points;
+
+               if (line_points.size() > 1) {
+                       line->property_points() = line_points;
+               }
        }
        
        _drag_distance += dx;