diff --git a/libs/canvas/canvas/rectangle.h b/libs/canvas/canvas/rectangle.h index 8b65940454..351074cc42 100644 --- a/libs/canvas/canvas/rectangle.h +++ b/libs/canvas/canvas/rectangle.h @@ -87,10 +87,6 @@ public: void set_outline_what (What); void set_outline_all () { set_outline_what (ArdourCanvas::Rectangle::ALL); } - protected: - void render_self (Rect const &, Cairo::RefPtr, Rect) const; - Rect get_self_for_render () const; - private: /** Our rectangle; note that x0 may not always be less than x1 * and likewise with y0 and y1. diff --git a/libs/canvas/rectangle.cc b/libs/canvas/rectangle.cc index 488d5bf1fe..985dcb6815 100644 --- a/libs/canvas/rectangle.cc +++ b/libs/canvas/rectangle.cc @@ -55,8 +55,8 @@ Rectangle::Rectangle (Item* parent, Rect const & rect) { } -Rect -Rectangle::get_self_for_render () const +void +Rectangle::render (Rect const & area, Cairo::RefPtr context) const { /* In general, a Rectangle will have a _position of (0,0) within its parent, and its extent is actually defined by _rect. But in the @@ -64,20 +64,13 @@ Rectangle::get_self_for_render () const we should take that into account when rendering. */ - return item_to_window (_rect.translate (_position), false); -} + Rect self (item_to_window (_rect.translate (_position), false)); + const Rect draw = self.intersection (area); -void -Rectangle::render_self (Rect const & area, Cairo::RefPtr context, Rect self) const -{ - Rect r = self.intersection (area); - - if (!r) { + if (!draw) { return; } - Rect draw = r; - if (_fill && !_transparent) { if (_stops.empty()) { setup_fill_context (context); @@ -142,12 +135,6 @@ Rectangle::render_self (Rect const & area, Cairo::RefPtr context } } -void -Rectangle::render (Rect const & area, Cairo::RefPtr context) const -{ - render_self (area, context, get_self_for_render ()); -} - void Rectangle::compute_bounding_box () const {