Files
yoga/javascript/src/Config.cpp
Nick Gerleman c35f8819ae Breaking: Remove "UseLegacyStretchBehaviour" functions (#1368)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1368

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

These were marked as deprecated as part of the public Yoga 2.0 release, and were alredy emitting deprecation warnings. Remove them.

Reviewed By: javache

Differential Revision: D49131250

fbshipit-source-id: cc1d4e8b179697b9a11a685f4fc4e9d36e1a26a0
2023-09-11 19:51:40 -07:00

55 lines
1.3 KiB
C++

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <yoga/Yoga.h>
#include "./Config.h"
/* static */ Config* Config::create(void) {
return new Config();
}
/* static */ void Config::destroy(Config* node) {
delete node;
}
Config::Config(void) : m_config(YGConfigNew()) {}
Config::~Config(void) {
YGConfigFree(m_config);
}
void Config::setExperimentalFeatureEnabled(int feature, bool enabled) {
YGConfigSetExperimentalFeatureEnabled(
m_config, static_cast<YGExperimentalFeature>(feature), enabled);
}
void Config::setPointScaleFactor(float pixelsInPoint) {
YGConfigSetPointScaleFactor(m_config, pixelsInPoint);
}
void Config::setErrata(int errata) {
YGConfigSetErrata(m_config, static_cast<YGErrata>(errata));
}
void Config::setUseWebDefaults(bool useWebDefaults) {
YGConfigSetUseWebDefaults(m_config, useWebDefaults);
}
bool Config::isExperimentalFeatureEnabled(int feature) const {
return YGConfigIsExperimentalFeatureEnabled(
m_config, static_cast<YGExperimentalFeature>(feature));
}
int Config::getErrata() const {
return static_cast<int>(YGConfigGetErrata(m_config));
}
bool Config::useWebDefaults() const {
return YGConfigGetUseWebDefaults(m_config);
}