mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 13:43:45 +03:00
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.
This commit is contained in:
parent
8e6c320af1
commit
29102051d9
Notes:
sideshowbarker
2024-07-18 23:52:05 +09:00
Author: https://github.com/Maato Commit: https://github.com/SerenityOS/serenity/commit/29102051d9c Pull-request: https://github.com/SerenityOS/serenity/pull/4947
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user