diff --git a/libs/canvas/box.cc b/libs/canvas/box.cc index 6e42ff094b..9d9217dd7d 100644 --- a/libs/canvas/box.cc +++ b/libs/canvas/box.cc @@ -172,6 +172,8 @@ Box::reposition_children () uniform_size = Rect (0, 0, largest_width, largest_height); } + Rect r; + { PBD::Unwinder uw (ignore_child_changes, true); @@ -189,6 +191,8 @@ Box::reposition_children () (*i)->size_request (width, height); + r = r.extend (Rect (previous_edge.x, previous_edge.y, previous_edge.x + width, previous_edge.y + height)); + if (orientation == Vertical) { Distance shift = 0; @@ -222,7 +226,11 @@ Box::reposition_children () } } - _bounding_box_dirty = true; + /* left and top margins+padding already reflected in child bboxes */ + + r = r.expand (0, right_margin + right_padding, bottom_margin + bottom_padding, 0); + + set (r); } void @@ -256,14 +264,6 @@ Box::layout () if (yes_do_it) { reposition_children (); - (void) bounding_box (); - - const double w = std::max (requested_width, _bounding_box.width()); - const double h = std::max (requested_height, _bounding_box.height()); - - set (Rect (get().x0, get().y0, get().x0 + w, get().y0 + h)); - - std::cerr << name << " box layed out, reset to " << get() << std::endl; } }