From 9bbedcb781cdb7d1dad1ee01bfa99c328c2813c2 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 10 Apr 2020 17:54:07 +0200 Subject: [PATCH] Remove unused function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- libs/canvas/canvas/poly_item.h | 1 - libs/canvas/poly_item.cc | 37 ---------------------------------- 2 files changed, 38 deletions(-) diff --git a/libs/canvas/canvas/poly_item.h b/libs/canvas/canvas/poly_item.h index 25a832e571..3df13ff75f 100644 --- a/libs/canvas/canvas/poly_item.h +++ b/libs/canvas/canvas/poly_item.h @@ -42,7 +42,6 @@ public: protected: void render_path (Rect const&, Cairo::RefPtr) const; - void render_curve (Rect const&, Cairo::RefPtr, Points const&, Points const&) const; Points _points; diff --git a/libs/canvas/poly_item.cc b/libs/canvas/poly_item.cc index 3ea68c461d..dfd8bf0da9 100644 --- a/libs/canvas/poly_item.cc +++ b/libs/canvas/poly_item.cc @@ -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 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) {