Skip to content

Commit

Permalink
Fix issue where we were not applying flex end correctly when justifyi…
Browse files Browse the repository at this point in the history
…ng (facebook#41691)

Summary:
X-link: facebook/yoga#1487


The code here was just wrong. I changed it to be the same logic as the Justify:FlexStart case, but with the flex end sides. Then I get the position for the opposite edge since we need to write to flex start side.

Reviewed By: NickGerleman

Differential Revision: D51383792
  • Loading branch information
Joe Vilches authored and facebook-github-bot committed Dec 5, 2023
1 parent b8836d3 commit 04d7fc0
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,14 @@ static void justifyAbsoluteChild(
break;
case Justify::FlexEnd:
child->setLayoutPosition(
(parent->getLayout().measuredDimension(dimension(mainAxis)) -
child->getLayout().measuredDimension(dimension(mainAxis))),
getPositionOfOppositeEdge(
parent->getLayout().border(flexEndEdge(mainAxis)) +
parent->getLayout().padding(flexEndEdge(mainAxis)) +
child->getFlexEndMargin(
mainAxis, direction, containingBlockWidth),
mainAxis,
parent,
child),
flexStartEdge(mainAxis));
break;
case Justify::Center:
Expand Down

0 comments on commit 04d7fc0

Please sign in to comment.