diff options
author | nick_m <mainsbridge@gmail.com> | 2016-10-17 01:28:33 +1100 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-10-17 01:28:33 +1100 |
commit | 92920307ae6c91924d94c7514ad050fe5ab64c3f (patch) | |
tree | db46e74e5e560ceaac49c92dd7e8ad8c97c0943c /libs/canvas | |
parent | 29f60441801d3dbef9d2f4fc0db04a9f883261c2 (diff) |
Tempo curve cleanup, now also works on optimized builds.
Diffstat (limited to 'libs/canvas')
-rw-r--r-- | libs/canvas/framed_curve.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libs/canvas/framed_curve.cc b/libs/canvas/framed_curve.cc index 748fb03ebd..b1e0952b1f 100644 --- a/libs/canvas/framed_curve.cc +++ b/libs/canvas/framed_curve.cc @@ -31,7 +31,7 @@ FramedCurve::FramedCurve (Canvas* c) : PolyItem (c) , n_samples (0) , points_per_segment (16) - , curve_fill (None) + , curve_fill (Inside) { } @@ -39,7 +39,7 @@ FramedCurve::FramedCurve (Item* parent) : PolyItem (parent) , n_samples (0) , points_per_segment (16) - , curve_fill (None) + , curve_fill (Inside) { } @@ -85,8 +85,15 @@ FramedCurve::interpolate () } samples.clear (); - InterpolatedCurve::interpolate (curve_points, points_per_segment, CatmullRomCentripetal, false, samples); - n_samples = samples.size(); + if (_points.size() == 3) { + samples.push_back (curve_points.front()); + samples.push_back (curve_points.back()); + n_samples = 2; + } else { + + InterpolatedCurve::interpolate (curve_points, points_per_segment, CatmullRomCentripetal, false, samples); + n_samples = samples.size(); + } } void |