1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:57:44 +00:00

LibWeb: Initial offset in reverse flex layout moved to opposite side

This change moves the initial offset for justify-content: center to the
opposite side if the flex layout is in the reverse direction.
This commit is contained in:
Emil Militzer 2023-05-08 17:46:17 +02:00 committed by Andreas Kling
parent 6ae208dbf6
commit 8200d1f68b
3 changed files with 33 additions and 0 deletions

View file

@ -1268,6 +1268,9 @@ void FlexFormattingContext::distribute_any_remaining_free_space()
break;
case CSS::JustifyContent::Center:
initial_offset = (inner_main_size(flex_container()) - used_main_space) / 2.0f;
if (is_direction_reverse()) {
initial_offset = inner_main_size(flex_container()) - initial_offset;
}
break;
case CSS::JustifyContent::SpaceBetween:
space_between_items = flex_line.remaining_free_space / (number_of_items - 1);