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
This commit is contained in:
Samuel Susla
2020-04-20 11:44:15 -07:00
committed by Facebook GitHub Bot
parent 57099962b7
commit e7ef35c133
@@ -18,7 +18,6 @@
#include <react/debug/DebugStringConvertibleItem.h>
#include <react/debug/SystraceSection.h>
#include <yoga/Yoga.h>
#include <iostream>
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);