From e7ef35c133ee8f6a1363598e2ccbb9415921a0a6 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 20 Apr 2020 11:41:56 -0700 Subject: [PATCH] Fix mistake in swapping left/right layout properties Summary: Changelog: [Internal] We were assigned `undefined` value to incorrect edge, instead of `YGEdgeLeft` it should have been `YGEdgeRight`. If node has `YGEdgeRight` value, it needs to be reassigned to `YGEdgeEnd` and its original value set to undefined. Reviewed By: mdvacca Differential Revision: D21095234 fbshipit-source-id: fbecd9b7e6670742ad4a4bb097760aa10eec8685 --- .../fabric/components/view/yoga/YogaLayoutableShadowNode.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp b/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp index 3f4c0bdbe90..b1a23d06eb2 100644 --- a/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp +++ b/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp @@ -18,7 +18,6 @@ #include #include #include -#include namespace facebook { namespace react { @@ -450,7 +449,7 @@ void YogaLayoutableShadowNode::swapLeftAndRightInYogaStyleProps( if (yogaStyle.margin()[YGEdgeRight] != YGValueUndefined) { yogaStyle.margin()[YGEdgeEnd] = margin[YGEdgeRight]; - yogaStyle.margin()[YGEdgeLeft] = YGValueUndefined; + yogaStyle.margin()[YGEdgeRight] = YGValueUndefined; } shadowNode.yogaNode_.setStyle(yogaStyle);