From 2de5ea06a911c7688bc7a879a1b524f57998e490 Mon Sep 17 00:00:00 2001 From: Joe Vilches Date: Thu, 7 Dec 2023 21:25:45 -0800 Subject: [PATCH] Fix bug where we used border box for size of containing block in a certain case Summary: X-link: https://github.com/facebook/yoga/pull/1486 X-link: https://github.com/facebook/react-native/pull/41688 Somehow missed this case. We never want to measure the CB as that gets border box but we want padding box Reviewed By: NickGerleman Differential Revision: D51376309 fbshipit-source-id: 2b5119c421ef92fadb28a70254cb7fe02aeb8c28 --- lib/yoga/src/main/cpp/yoga/algorithm/AbsoluteLayout.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/yoga/src/main/cpp/yoga/algorithm/AbsoluteLayout.cpp b/lib/yoga/src/main/cpp/yoga/algorithm/AbsoluteLayout.cpp index dae3719b21d..2dd6193f9ee 100644 --- a/lib/yoga/src/main/cpp/yoga/algorithm/AbsoluteLayout.cpp +++ b/lib/yoga/src/main/cpp/yoga/algorithm/AbsoluteLayout.cpp @@ -199,10 +199,7 @@ static void positionAbsoluteChildImpl( // necessary. if (child->isInlineStartPositionDefined(axis, direction)) { const float positionRelativeToInlineStart = - child->getInlineStartPosition( - axis, - direction, - containingNode->getLayout().measuredDimension(dimension(axis))) + + child->getInlineStartPosition(axis, direction, containingBlockSize) + containingNode->getInlineStartBorder(axis, direction) + child->getInlineStartMargin(axis, direction, containingBlockSize); const float positionRelativeToFlexStart =