From 603349d936189dc3453c3763abcae9e7c8848784 Mon Sep 17 00:00:00 2001 From: Joe Vilches Date: Thu, 7 Dec 2023 14:01:38 -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 Tsia. Added test and accounted for parent padding Reviewed By: NickGerleman Differential Revision: D51374086 --- .../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));