amend ab3889ff: portaudio backend uses a vector for connections
[ardour.git] / libs / canvas / framed_curve.cc
index d5bb23f4e7f1d9bcbc2fffb745549e86a2d993f1..2d22387fa4b506d9410c28eed0012fd80036ee70 100644 (file)
@@ -102,10 +102,10 @@ FramedCurve::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) c
                return;
        }
 
-       Rect self = item_to_window (_bounding_box.get());
-       boost::optional<Rect> d = self.intersection (area);
+       Rect self = item_to_window (_bounding_box);
+       Rect d = self.intersection (area);
        assert (d);
-       Rect draw = d.get ();
+       Rect draw = d;
 
        /* Our approach is to always draw n_segments across our total size.
         *
@@ -194,16 +194,15 @@ FramedCurve::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) c
                        case Outside:
                                context->stroke_preserve ();
                                window_space = item_to_window (Duple(_points.back().x, 0.0));
-                               context->line_to (window_space.x, window_space.y);
+                               context->line_to (last_point.x, window_space.y);
                                window_space = item_to_window (Duple(_points.front().x, 0.0));
-                               context->line_to (window_space.x, window_space.y);
+                               context->line_to (first_point.x, window_space.y);
                                context->close_path();
                                setup_fill_context(context);
                                context->fill ();
                                break;
                }
        } else {
-
                /* curve of at least 3 points */
 
                /* find left and right-most sample */
@@ -256,7 +255,7 @@ FramedCurve::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) c
                                break;
                        case Inside:
                                context->stroke_preserve ();
-                               /* close the frame, possibly using the last _point's x rather than samples[right].x */
+                               /* close the sample, possibly using the last _point's x rather than samples[right].x */
                                window_space = item_to_window (Duple (last_sample.x, draw.height()));
                                context->line_to (window_space.x, window_space.y);
                                window_space = item_to_window (Duple (first_sample.x, draw.height()));