fix crash when copy'ing latent plugins
[ardour.git] / libs / canvas / curve.cc
index ce479b28bbc986a4b37decb8ba93cf9142fa1dcf..280a3e3aaaf7688a04d41f0339ddf848bb3caca3 100644 (file)
@@ -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)
 {
 }
@@ -96,7 +101,7 @@ Curve::render (Rect const & area, Cairo::RefPtr<Cairo::Context> 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<Cairo::Context> 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<Cairo::Context> 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 */