diff options
author | Andreas Kling <kling@serenityos.org> | 2022-07-19 23:30:52 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-07-21 01:46:25 +0200 |
commit | b7003194d2cce2b75eb0860af9445a0b176b8abf (patch) | |
tree | 995079dd9500909f885737b2caef1c3f48313342 /Userland/Libraries/LibWeb | |
parent | a6e1b9eed2bc3ff938c9072ee621ac77d227b3fc (diff) | |
download | serenity-b7003194d2cce2b75eb0860af9445a0b176b8abf.zip |
LibWeb: Use right offset for `justify-content: flex-end`
Offsets in this algorithm are relative to the starting position, so it
should be 0 whether its `flex-start` or `flex-end`.
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp index cd37937fda..9b8d7a13f8 100644 --- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp @@ -1106,16 +1106,8 @@ void FlexFormattingContext::distribute_any_remaining_free_space() switch (flex_container().computed_values().justify_content()) { case CSS::JustifyContent::FlexStart: - if (is_direction_reverse()) - space_before_first_item = m_available_space->main.value_or(NumericLimits<float>::max()); - else - space_before_first_item = 0; - break; case CSS::JustifyContent::FlexEnd: - if (is_direction_reverse()) - space_before_first_item = 0; - else - space_before_first_item = m_available_space->main.value_or(NumericLimits<float>::max()); + space_before_first_item = 0; break; case CSS::JustifyContent::Center: space_before_first_item = (m_available_space->main.value_or(NumericLimits<float>::max()) - used_main_space) / 2.0f; |