Move leading border function as a method on YGNode

Summary: Move leading border function as a method on YGNode

Reviewed By: emilsjolander

Differential Revision: D6711523

fbshipit-source-id: 76e90083a9dd0728dc9557cc3b0a1f431f3afd5d
This commit is contained in:
Pritesh Nandgaonkar
2018-01-15 10:09:44 -08:00
committed by Facebook Github Bot
parent 5806f1728c
commit 6efb4b90d4
3 changed files with 22 additions and 26 deletions

View File

@@ -596,3 +596,15 @@ bool YGNode::isNodeFlexible() {
(style_.positionType == YGPositionTypeRelative) &&
(resolveFlexGrow() != 0 || resolveFlexShrink() != 0));
}
float YGNode::getLeadingBorder(const YGFlexDirection axis) {
if (YGFlexDirectionIsRow(axis) &&
style_.border[YGEdgeStart].unit != YGUnitUndefined &&
style_.border[YGEdgeStart].value >= 0.0f) {
return style_.border[YGEdgeStart].value;
}
return fmaxf(
YGComputedEdgeValue(style_.border, leading[axis], &YGValueZero)->value,
0.0f);
}