Moved trailingmargin function as a method on YGNode

Summary: Moved trailingmargin function as a method on YGNode

Reviewed By: emilsjolander

Differential Revision: D6683313

fbshipit-source-id: 5ee458c2f4698768724901df0e3f5d8805c7c8f5
This commit is contained in:
Pritesh Nandgaonkar
2018-01-11 04:47:46 -08:00
committed by Facebook Github Bot
parent a65b79a944
commit f2ba14c309
3 changed files with 24 additions and 27 deletions

View File

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