Moved leading padding function as a method on YGNode

Summary: Moved leading padding function as a method on YGNode

Reviewed By: emilsjolander

Differential Revision: D6711830

fbshipit-source-id: d2f6f55ec23b007bb51f8a91385e02236f46dc7b
This commit is contained in:
Pritesh Nandgaonkar
2018-01-15 10:09:51 -08:00
committed by Facebook Github Bot
parent 0a04bd7f2f
commit adb2e0fdd6
3 changed files with 20 additions and 21 deletions

View File

@@ -630,3 +630,18 @@ float YGNode::getTrailingBorder(const YGFlexDirection flexDirection) {
->value,
0.0f);
}
float YGNode::getLeadingPadding(
const YGFlexDirection axis,
const float widthSize) {
if (YGFlexDirectionIsRow(axis) &&
style_.padding[YGEdgeStart].unit != YGUnitUndefined &&
YGResolveValue(style_.padding[YGEdgeStart], widthSize) >= 0.0f) {
return YGResolveValue(style_.padding[YGEdgeStart], widthSize);
}
return fmaxf(
YGResolveValue(
*YGComputedEdgeValue(style_.padding, leading[axis], &YGValueZero),
widthSize),
0.0f);
}