From 107ff8466a999fe471164100a5308d9ea7556e4b Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 10 Sep 2021 13:01:26 -0600 Subject: [PATCH] canvas: box should not try to reposition children for a zero-sized allocation --- libs/canvas/box.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/canvas/box.cc b/libs/canvas/box.cc index dd751f0161..0bdd5294ce 100644 --- a/libs/canvas/box.cc +++ b/libs/canvas/box.cc @@ -268,6 +268,12 @@ Box::reposition_children (Distance width, Distance height, bool shrink_width, bo Distance largest_height = 0; Rect uniform_size; + if (width == 0 && height == 0) { + return; + } + + DEBUG_TRACE (DEBUG::CanvasBox|DEBUG::CanvasSizeAllocate, string_compose ("allocating children within %1 x %2, shrink/w %3 shrink/h %4\n", width, height, shrink_width, shrink_height)); + if (homogenous) { for (std::list::const_iterator i = _items.begin(); i != _items.end(); ++i) {