diff --git a/libs/canvas/container.cc b/libs/canvas/container.cc index f6e00950fe..8e1fa1a716 100644 --- a/libs/canvas/container.cc +++ b/libs/canvas/container.cc @@ -46,6 +46,28 @@ Container::prepare_for_render (Rect const & area) const void Container::render (Rect const & area, Cairo::RefPtr context) const { + if (fill() || outline()) { + + Rect bb (bounding_box()); + Rect self (item_to_window (bb, false)); + const Rect draw = self.intersection (area); + + std::cerr << whoami() << " render bb " << bb << " self " << self << " area " << area << " draw " << draw << std::endl; + + if (fill()) { + setup_fill_context (context); + context->rectangle (draw.x0, draw.y0, draw.width(), draw.height()); + context->fill_preserve (); + } + + if (outline()) { + if (!fill()) { + context->rectangle (draw.x0, draw.y0, draw.width(), draw.height()); + } + setup_outline_context (context); + context->stroke (); + } + } Item::render_children (area, context); } @@ -56,4 +78,3 @@ Container::compute_bounding_box () const add_child_bounding_boxes (); _bounding_box_dirty = false; } -