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

Add errata supporting changes to position: static #41130

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 @@ -13,6 +13,7 @@ public enum YogaErrata {
NONE(0),
STRETCH_FLEX_BASIS(1),
STARTING_ENDING_EDGE_FROM_FLEX_DIRECTION(2),
POSITION_STATIC_BEHAVES_LIKE_RELATIVE(4),
ALL(2147483647),
CLASSIC(2147483646);

Expand All @@ -31,6 +32,7 @@ public static YogaErrata fromInt(int value) {
case 0: return NONE;
case 1: return STRETCH_FLEX_BASIS;
case 2: return STARTING_ENDING_EDGE_FROM_FLEX_DIRECTION;
case 4: return POSITION_STATIC_BEHAVES_LIKE_RELATIVE;
case 2147483647: return ALL;
case 2147483646: return CLASSIC;
default: throw new IllegalArgumentException("Unknown enum value: " + value);
Expand Down
2 changes: 2 additions & 0 deletions packages/react-native/ReactCommon/yoga/yoga/YGEnums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ const char* YGErrataToString(const YGErrata value) {
return "stretch-flex-basis";
case YGErrataStartingEndingEdgeFromFlexDirection:
return "starting-ending-edge-from-flex-direction";
case YGErrataPositionStaticBehavesLikeRelative:
return "position-static-behaves-like-relative";
case YGErrataAll:
return "all";
case YGErrataClassic:
Expand Down
1 change: 1 addition & 0 deletions packages/react-native/ReactCommon/yoga/yoga/YGEnums.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ YG_ENUM_DECL(
YGErrataNone = 0,
YGErrataStretchFlexBasis = 1,
YGErrataStartingEndingEdgeFromFlexDirection = 2,
YGErrataPositionStaticBehavesLikeRelative = 4,
YGErrataAll = 2147483647,
YGErrataClassic = 2147483646)
YG_DEFINE_ENUM_FLAG_OPERATORS(YGErrata)
Expand Down
3 changes: 2 additions & 1 deletion packages/react-native/ReactCommon/yoga/yoga/enums/Errata.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ enum class Errata : uint32_t {
None = YGErrataNone,
StretchFlexBasis = YGErrataStretchFlexBasis,
StartingEndingEdgeFromFlexDirection = YGErrataStartingEndingEdgeFromFlexDirection,
PositionStaticBehavesLikeRelative = YGErrataPositionStaticBehavesLikeRelative,
All = YGErrataAll,
Classic = YGErrataClassic,
};
Expand All @@ -27,7 +28,7 @@ YG_DEFINE_ENUM_FLAG_OPERATORS(Errata)

template <>
constexpr inline int32_t ordinalCount<Errata>() {
return 5;
return 6;
}

template <>
Expand Down