LibWeb: Use right dimension when positioning flex-items

Previously the cross-size was used to determine the position along the
main axis which is obviously wrong.
This commit is contained in:
Tobias Christiansen 2021-09-13 22:13:23 +02:00 committed by Linus Groh
parent 8cd4a889fe
commit 416559414c
Notes: sideshowbarker 2024-07-18 04:00:14 +09:00

View file

@ -615,7 +615,7 @@ void FlexFormattingContext::run(Box& box, LayoutMode)
float used_main_space = 0;
size_t auto_margins = 0;
for (auto& flex_item : flex_line.items) {
used_main_space += flex_item->cross_size;
used_main_space += flex_item->main_size;
if (is_main_axis_margin_first_auto(flex_item->box))
++auto_margins;
if (is_main_axis_margin_second_auto(flex_item->box))