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:
committed by
Facebook Github Bot
parent
0a04bd7f2f
commit
adb2e0fdd6
@@ -762,24 +762,6 @@ static const std::array<YGEdge, 4> pos = {{
|
||||
static const std::array<YGDimension, 4> dim = {
|
||||
{YGDimensionHeight, YGDimensionHeight, YGDimensionWidth, YGDimensionWidth}};
|
||||
|
||||
static float YGNodeLeadingPadding(const YGNodeRef node,
|
||||
const YGFlexDirection axis,
|
||||
const float widthSize) {
|
||||
if (YGFlexDirectionIsRow(axis) &&
|
||||
node->getStyle().padding[YGEdgeStart].unit != YGUnitUndefined &&
|
||||
YGResolveValue(node->getStyle().padding[YGEdgeStart], widthSize) >=
|
||||
0.0f) {
|
||||
return YGResolveValue(node->getStyle().padding[YGEdgeStart], widthSize);
|
||||
}
|
||||
|
||||
return fmaxf(
|
||||
YGResolveValue(
|
||||
*YGComputedEdgeValue(
|
||||
node->getStyle().padding, leading[axis], &YGValueZero),
|
||||
widthSize),
|
||||
0.0f);
|
||||
}
|
||||
|
||||
static float YGNodeTrailingPadding(const YGNodeRef node,
|
||||
const YGFlexDirection axis,
|
||||
const float widthSize) {
|
||||
@@ -801,7 +783,7 @@ static inline float YGNodeLeadingPaddingAndBorder(
|
||||
const YGNodeRef node,
|
||||
const YGFlexDirection axis,
|
||||
const float widthSize) {
|
||||
return YGNodeLeadingPadding(node, axis, widthSize) +
|
||||
return node->getLeadingPadding(axis, widthSize) +
|
||||
node->getLeadingBorder(axis);
|
||||
}
|
||||
|
||||
@@ -1757,11 +1739,11 @@ static void YGNodelayoutImpl(const YGNodeRef node,
|
||||
node->getTrailingBorder(flexColumnDirection), YGEdgeBottom);
|
||||
|
||||
node->setLayoutPadding(
|
||||
YGNodeLeadingPadding(node, flexRowDirection, parentWidth), YGEdgeStart);
|
||||
node->getLeadingPadding(flexRowDirection, parentWidth), YGEdgeStart);
|
||||
node->setLayoutPadding(
|
||||
YGNodeTrailingPadding(node, flexRowDirection, parentWidth), YGEdgeEnd);
|
||||
node->setLayoutPadding(
|
||||
YGNodeLeadingPadding(node, flexColumnDirection, parentWidth), YGEdgeTop);
|
||||
node->getLeadingPadding(flexColumnDirection, parentWidth), YGEdgeTop);
|
||||
node->setLayoutPadding(
|
||||
YGNodeTrailingPadding(node, flexColumnDirection, parentWidth),
|
||||
YGEdgeBottom);
|
||||
|
Reference in New Issue
Block a user