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 (#41691)

Summary:
X-link: facebook/yoga#1487

Pull Request resolved: #41691

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

fbshipit-source-id: 372835a44edff361dbd84dd92ff9f2ec844b9f9c
  • Loading branch information
joevilches authored and facebook-github-bot committed Dec 8, 2023
1 parent 983e784 commit 579ef2b
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 579ef2b

Please sign in to comment.