@@ -797,21 +797,6 @@ static float YGNodeTrailingPadding(const YGNodeRef node,
797
797
0 .0f );
798
798
}
799
799
800
- static float YGNodeLeadingBorder (
801
- const YGNodeRef node,
802
- const YGFlexDirection axis) {
803
- if (YGFlexDirectionIsRow (axis) &&
804
- node->getStyle ().border [YGEdgeStart].unit != YGUnitUndefined &&
805
- node->getStyle ().border [YGEdgeStart].value >= 0 .0f ) {
806
- return node->getStyle ().border [YGEdgeStart].value ;
807
- }
808
-
809
- return fmaxf (
810
- YGComputedEdgeValue (node->getStyle ().border , leading[axis], &YGValueZero)
811
- ->value ,
812
- 0 .0f );
813
- }
814
-
815
800
static float YGNodeTrailingBorder (
816
801
const YGNodeRef node,
817
802
const YGFlexDirection axis) {
@@ -832,7 +817,7 @@ static inline float YGNodeLeadingPaddingAndBorder(
832
817
const YGFlexDirection axis,
833
818
const float widthSize) {
834
819
return YGNodeLeadingPadding (node, axis, widthSize) +
835
- YGNodeLeadingBorder ( node, axis);
820
+ node-> getLeadingBorder ( axis);
836
821
}
837
822
838
823
static inline float YGNodeTrailingPaddingAndBorder (const YGNodeRef node,
@@ -1235,7 +1220,7 @@ static void YGNodeAbsoluteLayoutChild(const YGNodeRef node,
1235
1220
if (child->isLeadingPositionDefined (YGFlexDirectionRow) &&
1236
1221
child->isTrailingPosDefined (YGFlexDirectionRow)) {
1237
1222
childWidth = node->getLayout ().measuredDimensions [YGDimensionWidth] -
1238
- (YGNodeLeadingBorder ( node, YGFlexDirectionRow) +
1223
+ (node-> getLeadingBorder ( YGFlexDirectionRow) +
1239
1224
YGNodeTrailingBorder (node, YGFlexDirectionRow)) -
1240
1225
(child->getLeadingPosition (YGFlexDirectionRow, width) +
1241
1226
child->getTrailingPosition (YGFlexDirectionRow, width));
@@ -1254,7 +1239,7 @@ static void YGNodeAbsoluteLayoutChild(const YGNodeRef node,
1254
1239
if (child->isLeadingPositionDefined (YGFlexDirectionColumn) &&
1255
1240
child->isTrailingPosDefined (YGFlexDirectionColumn)) {
1256
1241
childHeight = node->getLayout ().measuredDimensions [YGDimensionHeight] -
1257
- (YGNodeLeadingBorder ( node, YGFlexDirectionColumn) +
1242
+ (node-> getLeadingBorder ( YGFlexDirectionColumn) +
1258
1243
YGNodeTrailingBorder (node, YGFlexDirectionColumn)) -
1259
1244
(child->getLeadingPosition (YGFlexDirectionColumn, height) +
1260
1245
child->getTrailingPosition (YGFlexDirectionColumn, height));
@@ -1789,12 +1774,10 @@ static void YGNodelayoutImpl(const YGNodeRef node,
1789
1774
node->setLayoutMargin (
1790
1775
node->getTrailingMargin (flexColumnDirection, parentWidth), YGEdgeBottom);
1791
1776
1792
- node->setLayoutBorder (
1793
- YGNodeLeadingBorder (node, flexRowDirection), YGEdgeStart);
1777
+ node->setLayoutBorder (node->getLeadingBorder (flexRowDirection), YGEdgeStart);
1794
1778
node->setLayoutBorder (
1795
1779
YGNodeTrailingBorder (node, flexRowDirection), YGEdgeEnd);
1796
- node->setLayoutBorder (
1797
- YGNodeLeadingBorder (node, flexColumnDirection), YGEdgeTop);
1780
+ node->setLayoutBorder (node->getLeadingBorder (flexColumnDirection), YGEdgeTop);
1798
1781
node->setLayoutBorder (
1799
1782
YGNodeTrailingBorder (node, flexColumnDirection), YGEdgeBottom);
1800
1783
@@ -2459,7 +2442,7 @@ static void YGNodelayoutImpl(const YGNodeRef node,
2459
2442
// (and margin/border).
2460
2443
child->setLayoutPosition (
2461
2444
child->getLeadingPosition (mainAxis, availableInnerMainDim) +
2462
- YGNodeLeadingBorder ( node, mainAxis) +
2445
+ node-> getLeadingBorder ( mainAxis) +
2463
2446
child->getLeadingMargin (mainAxis, availableInnerWidth),
2464
2447
pos[mainAxis]);
2465
2448
}
@@ -2501,7 +2484,7 @@ static void YGNodelayoutImpl(const YGNodeRef node,
2501
2484
} else if (performLayout) {
2502
2485
child->setLayoutPosition (
2503
2486
child->getLayout ().position [pos[mainAxis]] +
2504
- YGNodeLeadingBorder ( node, mainAxis) + leadingMainDim,
2487
+ node-> getLeadingBorder ( mainAxis) + leadingMainDim,
2505
2488
pos[mainAxis]);
2506
2489
}
2507
2490
}
@@ -2552,15 +2535,15 @@ static void YGNodelayoutImpl(const YGNodeRef node,
2552
2535
if (isChildLeadingPosDefined) {
2553
2536
child->setLayoutPosition (
2554
2537
child->getLeadingPosition (crossAxis, availableInnerCrossDim) +
2555
- YGNodeLeadingBorder ( node, crossAxis) +
2538
+ node-> getLeadingBorder ( crossAxis) +
2556
2539
child->getLeadingMargin (crossAxis, availableInnerWidth),
2557
2540
pos[crossAxis]);
2558
2541
}
2559
2542
// If leading position is not defined or calculations result in Nan, default to border + margin
2560
2543
if (!isChildLeadingPosDefined ||
2561
2544
YGFloatIsUndefined (child->getLayout ().position [pos[crossAxis]])) {
2562
2545
child->setLayoutPosition (
2563
- YGNodeLeadingBorder ( node, crossAxis) +
2546
+ node-> getLeadingBorder ( crossAxis) +
2564
2547
child->getLeadingMargin (crossAxis, availableInnerWidth),
2565
2548
pos[crossAxis]);
2566
2549
}
0 commit comments