commit crash caused by not displaying first and last points of an automation line...
[ardour.git] / gtk2_ardour / automation_line.cc
index a319b325ed1bebd0bbbe592854c571492632c4dc..6002a69353b68109866633a522702c9dadf034e8 100644 (file)
@@ -746,10 +746,13 @@ AutomationLine::determine_visible_control_points (ALPoints& points)
                this_rx = (uint32_t) rint (tx);
                this_ry = (uint32_t) rint (ty); 
  
-               if (view_index && pi != npoints && (this_rx == prev_rx) && (this_ry == prev_ry) || 
-                   ((this_rx - prev_rx) < (box_size + 2))) {
+               if (view_index && pi != npoints && /* not the first, not the last */
+                   
+                   /* same point or too close to the last one horizontally */
+
+                   (((this_rx == prev_rx) && (this_ry == prev_ry)) || ((this_rx - prev_rx) < (box_size + 2)))) {
                        continue;
-               } 
+               }
 
                /* ok, we should display this point */
 
@@ -811,8 +814,6 @@ AutomationLine::determine_visible_control_points (ALPoints& points)
 
        /* discard extra CP's to avoid confusing ourselves */
 
-       cerr << "here we are, view_index = " << view_index << " cp size = " << control_points.size() << " np = " << npoints << endl;
-
        while (control_points.size() > view_index) {
                ControlPoint* cp = control_points.back();
                control_points.pop_back ();