yoga::Node::getStyle() to yoga::Node::style() (#1555)

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

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

The next diff moves a bunch of methods to `yoga::Style`. This renames the function to be a tad bit shorter, for more readable callsites. It also makes it more consistent with style property getters.

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D52803393

fbshipit-source-id: 557df34a9f0fb0ee42ad23b1fda99c1e0eb1d4e3
This commit is contained in:
Nick Gerleman
2024-01-19 11:28:06 -08:00
committed by Facebook GitHub Bot
parent d6a3b71085
commit 35b9b5223e
10 changed files with 121 additions and 122 deletions

View File

@@ -602,13 +602,13 @@ Style::Length Node::resolveFlexBasisPtr() const {
}
void Node::resolveDimension() {
const Style& style = getStyle();
for (auto dim : {Dimension::Width, Dimension::Height}) {
if (style.maxDimension(dim).isDefined() &&
yoga::inexactEquals(style.maxDimension(dim), style.minDimension(dim))) {
resolvedDimensions_[yoga::to_underlying(dim)] = style.maxDimension(dim);
if (style_.maxDimension(dim).isDefined() &&
yoga::inexactEquals(
style_.maxDimension(dim), style_.minDimension(dim))) {
resolvedDimensions_[yoga::to_underlying(dim)] = style_.maxDimension(dim);
} else {
resolvedDimensions_[yoga::to_underlying(dim)] = style.dimension(dim);
resolvedDimensions_[yoga::to_underlying(dim)] = style_.dimension(dim);
}
}
}