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