CompactValue -> Style::Length (#1458)
Summary: X-link: https://github.com/facebook/react-native/pull/41392 Pull Request resolved: https://github.com/facebook/yoga/pull/1458 We're moving `CompactValue` to be an internal detail of `yoga::Style`, where users outside of the style will be dealing with a resolved/non-compact representation. This change renames usages of `CompactValue` to `Style::Length`, which will be Yoga's representation for CSS input lengths. Right now one is just a type alias of the other, but this will let us change the internals of CompactValue with the rest of the world looking the same. A few factory functions are added to `yoga::value` for creating CSS values. There are some shenanigans around how we want to represent CSS pixels (one YGUnitPoint), when we also end up adding CSS points (slightly larger than one YGUnitPoint). For now, I reused `point` until making other changes. Changelog: [Internal] Reviewed By: yungsters Differential Revision: D51000389 fbshipit-source-id: 00f55e72bfb8aa291b53308f8a62ac8797be490f
This commit is contained in:
committed by
Facebook GitHub Bot
parent
a822f2635e
commit
aca02406ef
@@ -20,7 +20,6 @@
|
||||
#include <yoga/enums/MeasureMode.h>
|
||||
#include <yoga/enums/NodeType.h>
|
||||
#include <yoga/node/LayoutResults.h>
|
||||
#include <yoga/style/CompactValue.h>
|
||||
#include <yoga/style/Style.h>
|
||||
|
||||
// Tag struct used to form the opaque YGNodeRef for the public C API
|
||||
@@ -66,10 +65,10 @@ class YG_EXPORT Node : public ::YGNode {
|
||||
}
|
||||
|
||||
template <auto Field>
|
||||
CompactValue computeEdgeValueForColumn(YGEdge edge) const;
|
||||
Style::Length computeEdgeValueForColumn(YGEdge edge) const;
|
||||
|
||||
template <auto Field>
|
||||
CompactValue computeEdgeValueForRow(YGEdge rowEdge, YGEdge edge) const;
|
||||
Style::Length computeEdgeValueForRow(YGEdge rowEdge, YGEdge edge) const;
|
||||
|
||||
// DANGER DANGER DANGER!
|
||||
// If the node assigned to has children, we'd either have to deallocate
|
||||
@@ -327,7 +326,7 @@ class YG_EXPORT Node : public ::YGNode {
|
||||
uint32_t computedFlexBasisGeneration);
|
||||
void setLayoutMeasuredDimension(float measuredDimension, Dimension dimension);
|
||||
void setLayoutHadOverflow(bool hadOverflow);
|
||||
void setLayoutDimension(float dimensionValue, Dimension dimension);
|
||||
void setLayoutDimension(float LengthValue, 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