From 29102051d9c3e667351b70de1fa28ccdfb2d10cb Mon Sep 17 00:00:00 2001 From: Mart G Date: Thu, 14 Jan 2021 12:37:08 +0100 Subject: [PATCH] SpaceAnalyzer: Fix TreeMapWidget layout issue for small rects. For small rects there was a disagreement between two parts of the layout algorithm. There is a function that decides if there is enough space in a rectangle for a label. But this function was called on two slightly different rectangles. --- Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp index 97d9b58a9e..a31c144cda 100644 --- a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp +++ b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp @@ -84,7 +84,7 @@ Gfx::IntRect TreeMapWidget::inner_rect_for_frame(const Gfx::IntRect& rect) const Gfx::IntRect tmp_rect = rect; tmp_rect.shrink(2, 2); // border tmp_rect.shrink(2, 2); // shading - if (rect_can_contain_label(rect)) { + if (rect_can_contain_label(tmp_rect)) { tmp_rect.set_y(tmp_rect.y() + font().presentation_size() + margin); tmp_rect.set_height(tmp_rect.height() - (font().presentation_size() + margin * 2)); tmp_rect.set_x(tmp_rect.x() + margin);