diff options
author | Karol Kosek <krkk@krkk.ct8.pl> | 2021-07-28 10:46:46 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-28 16:01:51 +0200 |
commit | 2ded2a8b15bb19ca76cc433c176c2075f9f34d94 (patch) | |
tree | b5742b47269e993339202fd050daf4c7ae315811 /Userland | |
parent | 3bbab9eb4787a32347e72f8e894493b41dc29b37 (diff) | |
download | serenity-2ded2a8b15bb19ca76cc433c176c2075f9f34d94.zip |
SpaceAnalyzer: Adjust the text_rect
The text_rect was moved to the bottom right instead of being shrinked,
which meant that the text at the end could go a bit out of the box.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp index 1af61c3fc9..487c1b655c 100644 --- a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp +++ b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp @@ -93,13 +93,13 @@ void TreeMapWidget::paint_cell_frame(GUI::Painter& painter, const TreeMapNode& n // Paint text. if (has_label == HasLabel::Yes) { - painter.clear_clip_rect(); - painter.add_clip_rect(cell_rect); Gfx::IntRect text_rect = remainder; - text_rect.translate_by(2, 2); + text_rect.shrink(4, 4); + painter.clear_clip_rect(); + painter.add_clip_rect(text_rect); if (node_is_leaf(node)) { painter.draw_text(text_rect, node.name(), font(), Gfx::TextAlignment::TopLeft, Color::Black); - text_rect.translate_by(0, font().presentation_size() + 1); + text_rect.take_from_top(font().presentation_size() + 1); painter.draw_text(text_rect, human_readable_size(node.area()), font(), Gfx::TextAlignment::TopLeft, Color::Black); } else { painter.draw_text(text_rect, String::formatted("{} - {}", node.name(), human_readable_size(node.area())), font(), Gfx::TextAlignment::TopLeft, Color::Black); |