1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:48:11 +00:00

LibWeb: LayoutNodes know whether they are flex-items

This is useful for debugging when dumping the layout tree.
This commit is contained in:
Tobias Christiansen 2021-05-29 22:36:15 +02:00 committed by Ali Mohammad Pur
parent 2205239d9a
commit 7f81c8fba2
3 changed files with 10 additions and 1 deletions

View file

@ -42,6 +42,8 @@ void FlexFormattingContext::run(Box& box, LayoutMode layout_mode)
float tallest_child_height = 0;
float widest_child_width = 0;
box.for_each_child_of_type<Box>([&](Box& child_box) {
child_box.set_flex_item(true);
child_box.set_offset(x, y);
tallest_child_height = max(tallest_child_height, child_box.height());
widest_child_width = max(widest_child_width, child_box.width());