MIDI Transform channel-count 1..16 (not 0..15)
[ardour.git] / libs / canvas / framed_curve.cc
index d5bb23f4e7f1d9bcbc2fffb745549e86a2d993f1..66145f718323b691c856e2e39dc9f31fc249c6fe 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 */