Setting flags for margin, padding, position and border

Summary:
We set flags to true when setting margin, padding, border, position individually
Doing the same for batching API

Reviewed By: davidaurelio

Differential Revision: D14207550

fbshipit-source-id: ddfdcd5056bea0dd76bd6762f47e90370e26c9e1
This commit is contained in:
Sidharth Guglani
2019-02-28 12:42:24 -08:00
committed by Facebook Github Bot
parent 2abd9dd91b
commit b047af25ca

View File

@@ -800,28 +800,34 @@ static void YGNodeSetStyleInputs(
case Margin: {
float edge = *styleInputs++;
float marginValue = *styleInputs++;
ygNodeRefToYGNodeContext(node)->edgeSetFlag |= MARGIN;
YGNodeStyleSetMargin(node, static_cast<YGEdge>(edge), marginValue);
break;
}
case MarginPercent: {
float edge = *styleInputs++;
float marginPercent = *styleInputs++;
ygNodeRefToYGNodeContext(node)->edgeSetFlag |= MARGIN;
YGNodeStyleSetMarginPercent(
node, static_cast<YGEdge>(edge), marginPercent);
break;
}
case MarginAuto:
case MarginAuto: {
ygNodeRefToYGNodeContext(node)->edgeSetFlag |= MARGIN;
YGNodeStyleSetMarginAuto(node, static_cast<YGEdge>(*styleInputs++));
break;
}
case Padding: {
float edge = *styleInputs++;
float paddingValue = *styleInputs++;
ygNodeRefToYGNodeContext(node)->edgeSetFlag |= PADDING;
YGNodeStyleSetPadding(node, static_cast<YGEdge>(edge), paddingValue);
break;
}
case PaddingPercent: {
float edge = *styleInputs++;
float paddingPercent = *styleInputs++;
ygNodeRefToYGNodeContext(node)->edgeSetFlag |= PADDING;
YGNodeStyleSetPaddingPercent(
node, static_cast<YGEdge>(edge), paddingPercent);
break;
@@ -829,6 +835,7 @@ static void YGNodeSetStyleInputs(
case Border: {
float edge = *styleInputs++;
float borderValue = *styleInputs++;
ygNodeRefToYGNodeContext(node)->edgeSetFlag |= BORDER;
YGNodeStyleSetBorder(node, static_cast<YGEdge>(edge), borderValue);
break;
}