mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
LibWeb: Flexbox: Use right margins when direction is column
Previously both branches of the if were the same which is obviously not correct.
This commit is contained in:
parent
f188e48c3c
commit
01a716d529
Notes:
sideshowbarker
2024-07-18 02:49:03 +09:00
Author: https://github.com/TobyAsE Commit: https://github.com/SerenityOS/serenity/commit/01a716d5294 Pull-request: https://github.com/SerenityOS/serenity/pull/10440
1 changed files with 5 additions and 4 deletions
|
@ -287,16 +287,17 @@ void FlexFormattingContext::run(Box& box, LayoutMode)
|
|||
};
|
||||
auto populate_specified_margins = [&is_row](FlexItem& item) {
|
||||
auto width_of_containing_block = item.box.width_of_logical_containing_block();
|
||||
// FIXME: This should also take reverse-ness into account
|
||||
if (is_row) {
|
||||
item.margins.main_before = item.box.computed_values().margin().left.resolved_or_zero(item.box, width_of_containing_block).to_px(item.box);
|
||||
item.margins.main_after = item.box.computed_values().margin().right.resolved_or_zero(item.box, width_of_containing_block).to_px(item.box);
|
||||
item.margins.cross_before = item.box.computed_values().margin().top.resolved_or_zero(item.box, width_of_containing_block).to_px(item.box);
|
||||
item.margins.cross_after = item.box.computed_values().margin().bottom.resolved_or_zero(item.box, width_of_containing_block).to_px(item.box);
|
||||
} else {
|
||||
item.margins.main_before = item.box.computed_values().margin().left.resolved_or_zero(item.box, width_of_containing_block).to_px(item.box);
|
||||
item.margins.main_after = item.box.computed_values().margin().right.resolved_or_zero(item.box, width_of_containing_block).to_px(item.box);
|
||||
item.margins.cross_before = item.box.computed_values().margin().top.resolved_or_zero(item.box, width_of_containing_block).to_px(item.box);
|
||||
item.margins.cross_after = item.box.computed_values().margin().bottom.resolved_or_zero(item.box, width_of_containing_block).to_px(item.box);
|
||||
item.margins.main_before = item.box.computed_values().margin().top.resolved_or_zero(item.box, width_of_containing_block).to_px(item.box);
|
||||
item.margins.main_after = item.box.computed_values().margin().bottom.resolved_or_zero(item.box, width_of_containing_block).to_px(item.box);
|
||||
item.margins.cross_before = item.box.computed_values().margin().left.resolved_or_zero(item.box, width_of_containing_block).to_px(item.box);
|
||||
item.margins.cross_after = item.box.computed_values().margin().right.resolved_or_zero(item.box, width_of_containing_block).to_px(item.box);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue