Skip to content

Commit

Permalink
vaev-layout: fix on flex justify-content's space-between
Browse files Browse the repository at this point in the history
  • Loading branch information
pauloamed committed Dec 23, 2024
1 parent bf6b06f commit 5c04132
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/web/vaev-layout/flex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ struct FlexLine {
}
}

// https://www.w3.org/TR/css-flexbox-1/#justify-content-property
void justifyContent(Style::Align::Keywords justifyContent, Px mainSize, Px occupiedSize) {
switch (justifyContent) {
case Style::Align::SPACE_AROUND:
Expand All @@ -603,7 +604,10 @@ struct FlexLine {
break;

case Style::Align::SPACE_BETWEEN:
alignMainSpaceBetween(mainSize, occupiedSize);
if (occupiedSize > mainSize or items.len() == 1)
alignMainFlexStart();
else
alignMainSpaceBetween(mainSize, occupiedSize);
break;

case Style::Align::FLEX_START:
Expand Down

0 comments on commit 5c04132

Please sign in to comment.