mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:18:12 +00:00
LibWeb: Take margin box into account when justifying flex items
Before this patch, we were justifying based on the content box only, which led to misalignments along the main axis when items had non-zero padding, borders or margins.
This commit is contained in:
parent
96c9ca502b
commit
6ecf7db87b
1 changed files with 4 additions and 0 deletions
|
@ -1105,6 +1105,10 @@ void FlexFormattingContext::distribute_any_remaining_free_space()
|
|||
|
||||
if (is_main_axis_margin_second_auto(flex_item->box))
|
||||
++auto_margins;
|
||||
|
||||
used_main_space += flex_item->margins.main_before + flex_item->margins.main_after
|
||||
+ flex_item->borders.main_before + flex_item->borders.main_after
|
||||
+ flex_item->padding.main_before + flex_item->padding.main_after;
|
||||
}
|
||||
|
||||
if (flex_line.remaining_free_space > 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue