Moved getLeadingMargin as a function on YGNode

Summary: Moved getLeadingMargin as a function on YGNode

Reviewed By: emilsjolander

Differential Revision: D6683270

fbshipit-source-id: a26663006419e13cb783e9849183e3c665f59b3c
This commit is contained in:
Pritesh Nandgaonkar
2018-01-11 04:47:45 -08:00
committed by Facebook Github Bot
parent 681b580fd8
commit a65b79a944
4 changed files with 37 additions and 37 deletions

View File

@@ -137,6 +137,19 @@ bool YGNode::isTrailingPosDefined(const YGFlexDirection axis) {
->unit != YGUnitUndefined;
}
float YGNode::getLeadingMargin(
const YGFlexDirection axis,
const float widthSize) {
if (YGFlexDirectionIsRow(axis) &&
style_.margin[YGEdgeStart].unit != YGUnitUndefined) {
return YGResolveValueMargin(style_.margin[YGEdgeStart], widthSize);
}
return YGResolveValueMargin(
*YGComputedEdgeValue(style_.margin, leading[axis], &YGValueZero),
widthSize);
}
// Setters
void YGNode::setContext(void* context) {