Moved is isTrailingPos defined as a method on YGNode
Reviewed By: emilsjolander Differential Revision: D6683190 fbshipit-source-id: c37e57d02cc4475eb8181a2bb003c555bdb0aaea
This commit is contained in:
parent
98a74b0a2b
commit
040197a485
|
@ -110,6 +110,14 @@ bool YGNode::isLeadingPositionDefined(const YGFlexDirection axis) {
|
||||||
->unit != YGUnitUndefined;
|
->unit != YGUnitUndefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool YGNode::isTrailingPosDefined(const YGFlexDirection axis) {
|
||||||
|
return (YGFlexDirectionIsRow(axis) &&
|
||||||
|
YGComputedEdgeValue(style_.position, YGEdgeEnd, &YGValueUndefined)
|
||||||
|
->unit != YGUnitUndefined) ||
|
||||||
|
YGComputedEdgeValue(style_.position, trailing[axis], &YGValueUndefined)
|
||||||
|
->unit != YGUnitUndefined;
|
||||||
|
}
|
||||||
|
|
||||||
// Setters
|
// Setters
|
||||||
|
|
||||||
void YGNode::setContext(void* context) {
|
void YGNode::setContext(void* context) {
|
||||||
|
|
|
@ -78,6 +78,7 @@ struct YGNode {
|
||||||
YGValue getResolvedDimension(int index);
|
YGValue getResolvedDimension(int index);
|
||||||
float getLeadingPosition(const YGFlexDirection axis, const float axisSize);
|
float getLeadingPosition(const YGFlexDirection axis, const float axisSize);
|
||||||
bool isLeadingPositionDefined(const YGFlexDirection axis);
|
bool isLeadingPositionDefined(const YGFlexDirection axis);
|
||||||
|
bool isTrailingPosDefined(const YGFlexDirection axis);
|
||||||
|
|
||||||
// Setters
|
// Setters
|
||||||
|
|
||||||
|
|
|
@ -999,17 +999,6 @@ static inline bool YGNodeIsLayoutDimDefined(const YGNodeRef node, const YGFlexDi
|
||||||
return !YGFloatIsUndefined(value) && value >= 0.0f;
|
return !YGFloatIsUndefined(value) && value >= 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline bool YGNodeIsTrailingPosDefined(const YGNodeRef node, const YGFlexDirection axis) {
|
|
||||||
return (YGFlexDirectionIsRow(axis) &&
|
|
||||||
YGComputedEdgeValue(
|
|
||||||
node->getStyle().position, YGEdgeEnd, &YGValueUndefined)
|
|
||||||
->unit != YGUnitUndefined) ||
|
|
||||||
YGComputedEdgeValue(
|
|
||||||
node->getStyle().position, trailing[axis], &YGValueUndefined)
|
|
||||||
->unit != YGUnitUndefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
static float YGNodeTrailingPosition(const YGNodeRef node,
|
static float YGNodeTrailingPosition(const YGNodeRef node,
|
||||||
const YGFlexDirection axis,
|
const YGFlexDirection axis,
|
||||||
const float axisSize) {
|
const float axisSize) {
|
||||||
|
@ -1342,7 +1331,7 @@ static void YGNodeAbsoluteLayoutChild(const YGNodeRef node,
|
||||||
// on the left/right
|
// on the left/right
|
||||||
// offsets if they're defined.
|
// offsets if they're defined.
|
||||||
if (child->isLeadingPositionDefined(YGFlexDirectionRow) &&
|
if (child->isLeadingPositionDefined(YGFlexDirectionRow) &&
|
||||||
YGNodeIsTrailingPosDefined(child, YGFlexDirectionRow)) {
|
child->isTrailingPosDefined(YGFlexDirectionRow)) {
|
||||||
childWidth = node->getLayout().measuredDimensions[YGDimensionWidth] -
|
childWidth = node->getLayout().measuredDimensions[YGDimensionWidth] -
|
||||||
(YGNodeLeadingBorder(node, YGFlexDirectionRow) +
|
(YGNodeLeadingBorder(node, YGFlexDirectionRow) +
|
||||||
YGNodeTrailingBorder(node, YGFlexDirectionRow)) -
|
YGNodeTrailingBorder(node, YGFlexDirectionRow)) -
|
||||||
|
@ -1361,7 +1350,7 @@ static void YGNodeAbsoluteLayoutChild(const YGNodeRef node,
|
||||||
// based on the top/bottom
|
// based on the top/bottom
|
||||||
// offsets if they're defined.
|
// offsets if they're defined.
|
||||||
if (child->isLeadingPositionDefined(YGFlexDirectionColumn) &&
|
if (child->isLeadingPositionDefined(YGFlexDirectionColumn) &&
|
||||||
YGNodeIsTrailingPosDefined(child, YGFlexDirectionColumn)) {
|
child->isTrailingPosDefined(YGFlexDirectionColumn)) {
|
||||||
childHeight = node->getLayout().measuredDimensions[YGDimensionHeight] -
|
childHeight = node->getLayout().measuredDimensions[YGDimensionHeight] -
|
||||||
(YGNodeLeadingBorder(node, YGFlexDirectionColumn) +
|
(YGNodeLeadingBorder(node, YGFlexDirectionColumn) +
|
||||||
YGNodeTrailingBorder(node, YGFlexDirectionColumn)) -
|
YGNodeTrailingBorder(node, YGFlexDirectionColumn)) -
|
||||||
|
@ -1430,7 +1419,7 @@ static void YGNodeAbsoluteLayoutChild(const YGNodeRef node,
|
||||||
"abs-layout",
|
"abs-layout",
|
||||||
config);
|
config);
|
||||||
|
|
||||||
if (YGNodeIsTrailingPosDefined(child, mainAxis) &&
|
if (child->isTrailingPosDefined(mainAxis) &&
|
||||||
!child->isLeadingPositionDefined(mainAxis)) {
|
!child->isLeadingPositionDefined(mainAxis)) {
|
||||||
child->setLayoutPosition(
|
child->setLayoutPosition(
|
||||||
node->getLayout().measuredDimensions[dim[mainAxis]] -
|
node->getLayout().measuredDimensions[dim[mainAxis]] -
|
||||||
|
@ -1457,7 +1446,7 @@ static void YGNodeAbsoluteLayoutChild(const YGNodeRef node,
|
||||||
leading[mainAxis]);
|
leading[mainAxis]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (YGNodeIsTrailingPosDefined(child, crossAxis) &&
|
if (child->isTrailingPosDefined(crossAxis) &&
|
||||||
!child->isLeadingPositionDefined(crossAxis)) {
|
!child->isLeadingPositionDefined(crossAxis)) {
|
||||||
child->setLayoutPosition(
|
child->setLayoutPosition(
|
||||||
node->getLayout().measuredDimensions[dim[crossAxis]] -
|
node->getLayout().measuredDimensions[dim[crossAxis]] -
|
||||||
|
|
Loading…
Reference in New Issue