Back out "Modify private apis to set, store, and get intrinsic sizing keywords" (#1750)

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

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

These APIs were only added so that we could do TDD as we work on intrinsic sizing functionality. As of right now they do nothing. We are aiming on publishing a new version of Yoga soon so for the time being we are going to back these out so as not to confuse anyone with this new functionality. Ideally we get to a point where we have some temporary experimental header to stage these in but this is a bit time sensitive so just backing out for now

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66332307

fbshipit-source-id: 1d596964e0c893091c541988506e8b80fa6d1957
This commit is contained in:
Joe Vilches
2024-11-25 00:40:03 -08:00
committed by Facebook GitHub Bot
parent 0c995496c8
commit be00354b71
17 changed files with 54 additions and 317 deletions

View File

@@ -30,7 +30,6 @@
#include <yoga/enums/Wrap.h>
#include <yoga/numeric/FloatOptional.h>
#include <yoga/style/StyleLength.h>
#include <yoga/style/StyleSizeLength.h>
#include <yoga/style/StyleValuePool.h>
namespace facebook::yoga {
@@ -38,7 +37,6 @@ namespace facebook::yoga {
class YG_EXPORT Style {
public:
using Length = StyleLength;
using SizeLength = StyleSizeLength;
static constexpr float DefaultFlexGrow = 0.0f;
static constexpr float DefaultFlexShrink = 0.0f;
@@ -135,10 +133,10 @@ class YG_EXPORT Style {
pool_.store(flexShrink_, value);
}
Style::SizeLength flexBasis() const {
return pool_.getSize(flexBasis_);
Style::Length flexBasis() const {
return pool_.getLength(flexBasis_);
}
void setFlexBasis(Style::SizeLength value) {
void setFlexBasis(Style::Length value) {
pool_.store(flexBasis_, value);
}
@@ -177,17 +175,17 @@ class YG_EXPORT Style {
pool_.store(gap_[yoga::to_underlying(gutter)], value);
}
Style::SizeLength dimension(Dimension axis) const {
return pool_.getSize(dimensions_[yoga::to_underlying(axis)]);
Style::Length dimension(Dimension axis) const {
return pool_.getLength(dimensions_[yoga::to_underlying(axis)]);
}
void setDimension(Dimension axis, Style::SizeLength value) {
void setDimension(Dimension axis, Style::Length value) {
pool_.store(dimensions_[yoga::to_underlying(axis)], value);
}
Style::SizeLength minDimension(Dimension axis) const {
return pool_.getSize(minDimensions_[yoga::to_underlying(axis)]);
Style::Length minDimension(Dimension axis) const {
return pool_.getLength(minDimensions_[yoga::to_underlying(axis)]);
}
void setMinDimension(Dimension axis, Style::SizeLength value) {
void setMinDimension(Dimension axis, Style::Length value) {
pool_.store(minDimensions_[yoga::to_underlying(axis)], value);
}
@@ -209,10 +207,10 @@ class YG_EXPORT Style {
: FloatOptional{0.0});
}
Style::SizeLength maxDimension(Dimension axis) const {
return pool_.getSize(maxDimensions_[yoga::to_underlying(axis)]);
Style::Length maxDimension(Dimension axis) const {
return pool_.getLength(maxDimensions_[yoga::to_underlying(axis)]);
}
void setMaxDimension(Dimension axis, Style::SizeLength value) {
void setMaxDimension(Dimension axis, Style::Length value) {
pool_.store(maxDimensions_[yoga::to_underlying(axis)], value);
}