Move trailing border function as a method on YGNode

Summary: Move trailing border function as a method on YGNode

Reviewed By: emilsjolander

Differential Revision: D6711666

fbshipit-source-id: fe4fdfc2db59d03beb763317e1a6f9de52f851d4
This commit is contained in:
Pritesh Nandgaonkar
2018-01-15 10:09:46 -08:00
committed by Facebook Github Bot
parent 6efb4b90d4
commit 9d6af5b314
3 changed files with 22 additions and 23 deletions

View File

@@ -608,3 +608,16 @@ float YGNode::getLeadingBorder(const YGFlexDirection axis) {
YGComputedEdgeValue(style_.border, leading[axis], &YGValueZero)->value,
0.0f);
}
float YGNode::getTrailingBorder(const YGFlexDirection flexDirection) {
if (YGFlexDirectionIsRow(flexDirection) &&
style_.border[YGEdgeEnd].unit != YGUnitUndefined &&
style_.border[YGEdgeEnd].value >= 0.0f) {
return style_.border[YGEdgeEnd].value;
}
return fmaxf(
YGComputedEdgeValue(style_.border, trailing[flexDirection], &YGValueZero)
->value,
0.0f);
}