Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove YGExperimentalFeatureFixAbsoluteTrailingColumnMargin #37374

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
public enum YogaExperimentalFeature {
WEB_FLEX_BASIS(0),
ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE(1),
FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN(2),
FIX_JNILOCAL_REF_OVERFLOWS(3);
FIX_JNILOCAL_REF_OVERFLOWS(2);

private final int mIntValue;

Expand All @@ -29,8 +28,7 @@ public static YogaExperimentalFeature fromInt(int value) {
switch (value) {
case 0: return WEB_FLEX_BASIS;
case 1: return ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE;
case 2: return FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN;
case 3: return FIX_JNILOCAL_REF_OVERFLOWS;
case 2: return FIX_JNILOCAL_REF_OVERFLOWS;
default: throw new IllegalArgumentException("Unknown enum value: " + value);
}
}
Expand Down
2 changes: 0 additions & 2 deletions packages/react-native/ReactCommon/yoga/yoga/YGEnums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ const char* YGExperimentalFeatureToString(const YGExperimentalFeature value) {
return "web-flex-basis";
case YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge:
return "absolute-percentage-against-padding-edge";
case YGExperimentalFeatureFixAbsoluteTrailingColumnMargin:
return "fix-absolute-trailing-column-margin";
case YGExperimentalFeatureFixJNILocalRefOverflows:
return "fix-jnilocal-ref-overflows";
}
Expand Down
1 change: 0 additions & 1 deletion packages/react-native/ReactCommon/yoga/yoga/YGEnums.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ YG_ENUM_SEQ_DECL(
YGExperimentalFeature,
YGExperimentalFeatureWebFlexBasis,
YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge,
YGExperimentalFeatureFixAbsoluteTrailingColumnMargin,
YGExperimentalFeatureFixJNILocalRefOverflows)

YG_ENUM_SEQ_DECL(
Expand Down
10 changes: 2 additions & 8 deletions packages/react-native/ReactCommon/yoga/yoga/Yoga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1543,19 +1543,13 @@ static void YGNodeAbsoluteLayoutChild(
depth,
generationCount);

auto trailingMarginOuterSize =
node->getConfig()->isExperimentalFeatureEnabled(
YGExperimentalFeatureFixAbsoluteTrailingColumnMargin)
? isMainAxisRow ? height : width
: width;

if (child->isTrailingPosDefined(mainAxis) &&
!child->isLeadingPositionDefined(mainAxis)) {
child->setLayoutPosition(
node->getLayout().measuredDimensions[dim[mainAxis]] -
child->getLayout().measuredDimensions[dim[mainAxis]] -
node->getTrailingBorder(mainAxis) -
child->getTrailingMargin(mainAxis, trailingMarginOuterSize)
child->getTrailingMargin(mainAxis, isMainAxisRow ? width : height)
.unwrap() -
child->getTrailingPosition(mainAxis, isMainAxisRow ? width : height)
.unwrap(),
Expand Down Expand Up @@ -1598,7 +1592,7 @@ static void YGNodeAbsoluteLayoutChild(
node->getLayout().measuredDimensions[dim[crossAxis]] -
child->getLayout().measuredDimensions[dim[crossAxis]] -
node->getTrailingBorder(crossAxis) -
child->getTrailingMargin(crossAxis, trailingMarginOuterSize)
child->getTrailingMargin(crossAxis, isMainAxisRow ? height : width)
.unwrap() -
child
->getTrailingPosition(crossAxis, isMainAxisRow ? height : width)
Expand Down
Loading