Snow White and the Pharaoh (mac rendering)
[ardour.git] / libs / canvas / xfade_curve.cc
index 5e44d081a8d812ee9e3aa6ee5bf5dcd16b1e0107..01a15408ad5caeeb6e28926897cc0c64b17f9065 100644 (file)
@@ -35,7 +35,7 @@ static const bool show_bg_fades = false;
 #else
 static const bool show_bg_fades = true;
 #endif
-       
+
 XFadeCurve::XFadeCurve (Canvas* c)
        : Item (c)
        , points_per_segment (32)
@@ -118,7 +118,7 @@ XFadeCurve::compute_bounding_box () const
                _bounding_box = bbox.expand (1.0);
 
        } else {
-               _bounding_box = boost::optional<Rect> ();
+               _bounding_box = Rect ();
        }
 
        _bounding_box_dirty = false;
@@ -185,7 +185,7 @@ XFadeCurve::get_path(Rect const & area, Cairo::RefPtr<Cairo::Context> context, C
                        window_space = item_to_window (Duple (c.samples[idx].x, 0.0), false);
                        if (window_space.x >= area.x0) break;
                }
-               for (Points::size_type idx = c.n_samples; right > left;) {
+               for (Points::size_type idx = c.n_samples - 1; right > left;) {
                        if (--idx <= left) break;
                        window_space = item_to_window (Duple (c.samples[idx].x, 0.0), false);
                        if (window_space.x <= area.x1) break;
@@ -233,10 +233,10 @@ XFadeCurve::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) co
        if (_in.points.size() < 2) { return; }
        if (_out.points.size() < 2) { 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;
 
        context->save ();
        context->rectangle (draw.x0, draw.y0, draw.width(), draw.height());
@@ -287,7 +287,7 @@ XFadeCurve::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) co
        if (IS_START || show_background_fade) {
                set_source_rgba (context, IS_START ? _outline_color : outline_shaded);
                context->set_line_width (IS_START ? 1.0 : .5);
-        
+
                context->begin_new_path ();
                context->append_path (*path_in);
                context->stroke();