mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03: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
Notes:
sideshowbarker
2024-07-18 04:38:32 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/6ecf7db87b
@ -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…
Reference in New Issue
Block a user