C++ style enums 16/N: Dimension (#1403)
Summary: X-link: https://github.com/facebook/react-native/pull/39598 Pull Request resolved: https://github.com/facebook/yoga/pull/1403 Replaces all usages of YGDimension with Dimension. Adds `yoga::to_underlying` to act like `std::to_underlying`, added in C++ 23. This enum is oddly only used internally, and is never an input to the public API, but it handled as any other public generated enum. Potentially some more cleanup to do there. Changelog: [Internal] Reviewed By: rshest Differential Revision: D49475409 fbshipit-source-id: 7d4c31e8a84485baea0dab50b5cf16b86769fa07
This commit is contained in:
committed by
Facebook GitHub Bot
parent
8d24fcd90f
commit
a8566a0150
@@ -14,6 +14,7 @@
|
||||
#include <yoga/Yoga.h>
|
||||
|
||||
#include <yoga/config/Config.h>
|
||||
#include <yoga/enums/Dimension.h>
|
||||
#include <yoga/enums/Direction.h>
|
||||
#include <yoga/enums/Errata.h>
|
||||
#include <yoga/enums/MeasureMode.h>
|
||||
@@ -175,7 +176,7 @@ class YG_EXPORT Node : public ::YGNode {
|
||||
return resolvedDimensions_;
|
||||
}
|
||||
|
||||
YGValue getResolvedDimension(YGDimension dimension) const {
|
||||
YGValue getResolvedDimension(Dimension dimension) const {
|
||||
return resolvedDimensions_[static_cast<size_t>(dimension)];
|
||||
}
|
||||
|
||||
@@ -293,11 +294,9 @@ class YG_EXPORT Node : public ::YGNode {
|
||||
void setLayoutComputedFlexBasis(const FloatOptional computedFlexBasis);
|
||||
void setLayoutComputedFlexBasisGeneration(
|
||||
uint32_t computedFlexBasisGeneration);
|
||||
void setLayoutMeasuredDimension(
|
||||
float measuredDimension,
|
||||
YGDimension dimension);
|
||||
void setLayoutMeasuredDimension(float measuredDimension, Dimension dimension);
|
||||
void setLayoutHadOverflow(bool hadOverflow);
|
||||
void setLayoutDimension(float dimensionValue, YGDimension dimension);
|
||||
void setLayoutDimension(float dimensionValue, Dimension dimension);
|
||||
void setLayoutDirection(Direction direction);
|
||||
void setLayoutMargin(float margin, YGEdge edge);
|
||||
void setLayoutBorder(float border, YGEdge edge);
|
||||
|
Reference in New Issue
Block a user