X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fcanvas%2Fcurve.cc;h=dac9983e07701de4050ced07834432c80c0ec5c7;hb=657ba64ad23eaaa3cbf0e2da778a185fbc47a354;hp=ce479b28bbc986a4b37decb8ba93cf9142fa1dcf;hpb=8c9749e42faf7808034ed8b7afce4a2fe6dc6f33;p=ardour.git diff --git a/libs/canvas/curve.cc b/libs/canvas/curve.cc index ce479b28bb..dac9983e07 100644 --- a/libs/canvas/curve.cc +++ b/libs/canvas/curve.cc @@ -27,13 +27,18 @@ using namespace ArdourCanvas; using std::min; using std::max; -Curve::Curve (Group* parent) - : Item (parent) - , PolyItem (parent) - , Fill (parent) +Curve::Curve (Canvas* c) + : PolyItem (c) + , n_samples (0) + , points_per_segment (16) + , curve_fill (None) +{ +} + +Curve::Curve (Item* parent) + : PolyItem (parent) , n_samples (0) , points_per_segment (16) - , curve_type (CatmullRomCentripetal) , curve_fill (None) { } @@ -85,10 +90,10 @@ Curve::render (Rect const & area, Cairo::RefPtr context) const return; } - Rect self = item_to_window (_bounding_box.get()); - boost::optional 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. * @@ -96,7 +101,7 @@ Curve::render (Rect const & area, Cairo::RefPtr context) const * section of the curve. For now we rely on cairo clipping to help * with this. */ - + setup_outline_context (context); @@ -160,7 +165,7 @@ Curve::render (Rect const & area, Cairo::RefPtr context) const draw = draw.expand (4.0); /* now clip it to the actual points in the curve */ - + if (draw.x0 < w1.x) { draw.x0 = w1.x; } @@ -235,7 +240,7 @@ Curve::render (Rect const & area, Cairo::RefPtr context) const bool Curve::covers (Duple const & pc) const { - Duple point = canvas_to_item (pc); + Duple point = window_to_item (pc); /* O(N) N = number of points, and not accurate */