mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
LibWeb: Pack flex container from opposite end in *-reverse directions
This commit is contained in:
parent
b13a8706e1
commit
181fc6cead
Notes:
sideshowbarker
2024-07-17 06:22:53 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/181fc6cead
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue