LibWeb: Pack flex container from opposite end in *-reverse directions

This commit is contained in:
Andreas Kling 2022-10-04 01:02:29 +02:00
parent b13a8706e1
commit 181fc6cead
Notes: sideshowbarker 2024-07-17 06:22:53 +09:00

View file

@ -1173,11 +1173,20 @@ void FlexFormattingContext::distribute_any_remaining_free_space()
switch (flex_container().computed_values().justify_content()) {
case CSS::JustifyContent::FlexStart:
initial_offset = 0;
if (is_direction_reverse()) {
flex_region_render_cursor = FlexRegionRenderCursor::Right;
initial_offset = specified_main_size(flex_container());
} else {
initial_offset = 0;
}
break;
case CSS::JustifyContent::FlexEnd:
flex_region_render_cursor = FlexRegionRenderCursor::Right;
initial_offset = specified_main_size(flex_container());
if (is_direction_reverse()) {
initial_offset = 0;
} else {
flex_region_render_cursor = FlexRegionRenderCursor::Right;
initial_offset = specified_main_size(flex_container());
}
break;
case CSS::JustifyContent::Center:
initial_offset = (specified_main_size(flex_container()) - used_main_space) / 2.0f;