mirror of
https://github.com/status-im/react-native.git
synced 2025-02-27 16:40:38 +00:00
Moved trailing padding and border function as a method on YGNode
Reviewed By: emilsjolander Differential Revision: D6899571 fbshipit-source-id: 7f686e8771d5a94aae502191516557b20c557d7c
This commit is contained in:
parent
9daa17458a
commit
1475fc4856
@ -678,6 +678,12 @@ float YGNode::getLeadingPaddingAndBorder(
|
|||||||
return getLeadingPadding(axis, widthSize) + getLeadingBorder(axis);
|
return getLeadingPadding(axis, widthSize) + getLeadingBorder(axis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float YGNode::getTrailingPaddingAndBorder(
|
||||||
|
const YGFlexDirection axis,
|
||||||
|
const float widthSize) {
|
||||||
|
return getTrailingPadding(axis, widthSize) + getTrailingBorder(axis);
|
||||||
|
}
|
||||||
|
|
||||||
bool YGNode::didUseLegacyFlag() {
|
bool YGNode::didUseLegacyFlag() {
|
||||||
bool didUseLegacyFlag = layout_.didUseLegacyFlag;
|
bool didUseLegacyFlag = layout_.didUseLegacyFlag;
|
||||||
if (didUseLegacyFlag) {
|
if (didUseLegacyFlag) {
|
||||||
|
@ -94,6 +94,9 @@ struct YGNode {
|
|||||||
float getLeadingPaddingAndBorder(
|
float getLeadingPaddingAndBorder(
|
||||||
const YGFlexDirection axis,
|
const YGFlexDirection axis,
|
||||||
const float widthSize);
|
const float widthSize);
|
||||||
|
float getTrailingPaddingAndBorder(
|
||||||
|
const YGFlexDirection axis,
|
||||||
|
const float widthSize);
|
||||||
// Setters
|
// Setters
|
||||||
|
|
||||||
void setContext(void* context);
|
void setContext(void* context);
|
||||||
|
@ -797,13 +797,6 @@ static const std::array<YGEdge, 4> pos = {{
|
|||||||
static const std::array<YGDimension, 4> dim = {
|
static const std::array<YGDimension, 4> dim = {
|
||||||
{YGDimensionHeight, YGDimensionHeight, YGDimensionWidth, YGDimensionWidth}};
|
{YGDimensionHeight, YGDimensionHeight, YGDimensionWidth, YGDimensionWidth}};
|
||||||
|
|
||||||
static inline float YGNodeTrailingPaddingAndBorder(const YGNodeRef node,
|
|
||||||
const YGFlexDirection axis,
|
|
||||||
const float widthSize) {
|
|
||||||
return node->getTrailingPadding(axis, widthSize) +
|
|
||||||
node->getTrailingBorder(axis);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline float YGNodeMarginForAxis(const YGNodeRef node,
|
static inline float YGNodeMarginForAxis(const YGNodeRef node,
|
||||||
const YGFlexDirection axis,
|
const YGFlexDirection axis,
|
||||||
const float widthSize) {
|
const float widthSize) {
|
||||||
@ -815,7 +808,7 @@ static inline float YGNodePaddingAndBorderForAxis(const YGNodeRef node,
|
|||||||
const YGFlexDirection axis,
|
const YGFlexDirection axis,
|
||||||
const float widthSize) {
|
const float widthSize) {
|
||||||
return node->getLeadingPaddingAndBorder(axis, widthSize) +
|
return node->getLeadingPaddingAndBorder(axis, widthSize) +
|
||||||
YGNodeTrailingPaddingAndBorder(node, axis, widthSize);
|
node->getTrailingPaddingAndBorder(axis, widthSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline YGAlign YGNodeAlignItem(const YGNodeRef node, const YGNodeRef child) {
|
static inline YGAlign YGNodeAlignItem(const YGNodeRef node, const YGNodeRef child) {
|
||||||
@ -2202,7 +2195,7 @@ static void YGJustifyMainAxis(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
collectedFlexItemsValues.mainDim +=
|
collectedFlexItemsValues.mainDim +=
|
||||||
YGNodeTrailingPaddingAndBorder(node, mainAxis, parentWidth);
|
node->getTrailingPaddingAndBorder(mainAxis, parentWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user