13
0

Remove unused function

Cairo::curve_to renders cubic Bézier splines, those are not
generally useful in a DAW context.

Canvas::Curve implements centripetal catmull-rom spline drawing
which can be used for fades and automation interpolation.
This commit is contained in:
Robin Gareus 2020-04-10 17:54:07 +02:00
parent 7bb8ca1e76
commit 9bbedcb781
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 0 additions and 38 deletions

View File

@ -42,7 +42,6 @@ public:
protected:
void render_path (Rect const&, Cairo::RefPtr<Cairo::Context>) const;
void render_curve (Rect const&, Cairo::RefPtr<Cairo::Context>, Points const&, Points const&) const;
Points _points;

View File

@ -129,43 +129,6 @@ PolyItem::interpolate_line (Duple& c0, Duple const& c1, Coord const x)
return true;
}
void
PolyItem::render_curve (Rect const & area, Cairo::RefPtr<Cairo::Context> context, Points const & first_control_points, Points const & second_control_points) const
{
if (_points.size() <= 2) {
render_path (area, context);
return;
}
Points::const_iterator cp1 = first_control_points.begin();
Points::const_iterator cp2 = second_control_points.begin();
Points::const_iterator p = _points.begin();
const double pixel_adjust = (_outline_width == 1.0 ? 0.5 : 0.0);
Duple c = item_to_window (Duple (p->x, p->y));
context->move_to (c.x + pixel_adjust, c.y + pixel_adjust);
++p;
while (p != _points.end()) {
Duple c1 = item_to_window (Duple (cp1->x, cp1->y));
Duple c2 = item_to_window (Duple (cp2->x, cp2->y));
c = item_to_window (Duple (p->x, p->y));
context->curve_to (c1.x + pixel_adjust,
c1.y + pixel_adjust,
c2.x + pixel_adjust,
c2.y + pixel_adjust,
c.x + pixel_adjust,
c.y + pixel_adjust);
++cp1;
++cp2;
++p;
}
}
void
PolyItem::set (Points const & points)
{