From ea3dd6b4f2ecaac79476796ed2a11fe198299506 Mon Sep 17 00:00:00 2001 From: Joe Vilches Date: Thu, 7 Dec 2023 21:25:45 -0800 Subject: [PATCH] Fix bug with align start not taking into account parent padding (#41687) Summary: X-link: https://github.com/facebook/yoga/pull/1484 Pull Request resolved: https://github.com/facebook/react-native/pull/41687 Tsia. Added test and accounted for parent padding Reviewed By: NickGerleman Differential Revision: D51374086 fbshipit-source-id: ed9d79887aa1613ea93c10c639cd1465271d23d8 --- .../ReactCommon/yoga/yoga/algorithm/AbsoluteLayout.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactCommon/yoga/yoga/algorithm/AbsoluteLayout.cpp b/packages/react-native/ReactCommon/yoga/yoga/algorithm/AbsoluteLayout.cpp index d421db548746de..dae3719b21d65c 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/algorithm/AbsoluteLayout.cpp +++ b/packages/react-native/ReactCommon/yoga/yoga/algorithm/AbsoluteLayout.cpp @@ -72,7 +72,8 @@ static void alignAbsoluteChild( case Align::Stretch: case Align::SpaceEvenly: child->setLayoutPosition( - parent->getFlexStartBorder(crossAxis, direction) + + parent->getLayout().border(flexStartEdge(crossAxis)) + + parent->getLayout().padding(flexStartEdge(crossAxis)) + child->getFlexStartMargin( crossAxis, direction, containingBlockWidth), flexStartEdge(crossAxis));