Do not expose aggregate style edges (#1477)

Summary:
X-link: https://github.com/facebook/react-native/pull/41610

Pull Request resolved: https://github.com/facebook/yoga/pull/1477

A reland of the main change in D50998164, moving away from exposing compound edge arrays directly.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D51512611

fbshipit-source-id: 2d4ceb89c9d76317feb9074aa271358a3abc0ee1
This commit is contained in:
Nick Gerleman
2023-11-22 22:43:41 -08:00
committed by Facebook GitHub Bot
parent 0ebac779aa
commit a822f2635e
6 changed files with 119 additions and 198 deletions

View File

@@ -65,6 +65,12 @@ class YG_EXPORT Node : public ::YGNode {
style_.alignContent() = Align::Stretch;
}
template <auto Field>
CompactValue computeEdgeValueForColumn(YGEdge edge) const;
template <auto Field>
CompactValue computeEdgeValueForRow(YGEdge rowEdge, YGEdge edge) const;
// DANGER DANGER DANGER!
// If the node assigned to has children, we'd either have to deallocate
// them (potentially incorrect) or ignore them (danger of leaks). Only ever
@@ -189,15 +195,6 @@ class YG_EXPORT Node : public ::YGNode {
return resolvedDimensions_[static_cast<size_t>(dimension)];
}
static CompactValue computeEdgeValueForColumn(
const Style::Edges& edges,
YGEdge edge);
static CompactValue computeEdgeValueForRow(
const Style::Edges& edges,
YGEdge rowEdge,
YGEdge edge);
// Methods related to positions, margin, padding and border
bool isFlexStartPositionDefined(FlexDirection axis) const;
bool isInlineStartPositionDefined(FlexDirection axis, Direction direction)