Node::styleDefinesDimension() -> Node::hasDefiniteLength() (#1526)
Summary: X-link: https://github.com/facebook/react-native/pull/41995 Pull Request resolved: https://github.com/facebook/yoga/pull/1526 This function has made quite the journey from something that originally made more sense. This renames, refactors, and adds documentation for what it actually does. This should eventually make its way into `yoga::Style` once computed style is moved into that structure. bypass-github-export-checks Reviewed By: joevilches Differential Revision: D52105718 fbshipit-source-id: 6492224dd2e10cef3c5fc6a139323ad189a0925c
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ca4ecc044d
commit
1f391dfc50
@@ -130,7 +130,14 @@ class YG_EXPORT Node : public ::YGNode {
|
||||
|
||||
bool isLayoutDimensionDefined(const FlexDirection axis);
|
||||
|
||||
bool styleDefinesDimension(const FlexDirection axis, const float ownerSize);
|
||||
/**
|
||||
* Whether the node has a "definite length" along the given axis.
|
||||
* https://www.w3.org/TR/css-sizing-3/#definite
|
||||
*/
|
||||
inline bool hasDefiniteLength(Dimension dimension, float ownerSize) {
|
||||
auto usedValue = getResolvedDimension(dimension).resolve(ownerSize);
|
||||
return usedValue.isDefined() && usedValue.unwrap() >= 0.0f;
|
||||
}
|
||||
|
||||
bool hasErrata(Errata errata) const {
|
||||
return config_->hasErrata(errata);
|
||||
|
Reference in New Issue
Block a user