Moved YGResolveFlexGrow as a method on YGNode
Summary: Moved YGResolveFlexGrow as a method on YGNode Reviewed By: emilsjolander Differential Revision: D6611385 fbshipit-source-id: 71660946c469fac77c5ffa0284c793e6adc9db7b
This commit is contained in:
committed by
Facebook Github Bot
parent
47892c17ce
commit
40eeefd4f7
@@ -421,3 +421,17 @@ void YGNode::markDirtyAndPropogate() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float YGNode::resolveFlexGrow() {
|
||||
// Root nodes flexGrow should always be 0
|
||||
if (parent_ == nullptr) {
|
||||
return 0.0;
|
||||
}
|
||||
if (!YGFloatIsUndefined(style_.flexGrow)) {
|
||||
return style_.flexGrow;
|
||||
}
|
||||
if (!YGFloatIsUndefined(style_.flex) && style_.flex > 0.0f) {
|
||||
return style_.flex;
|
||||
}
|
||||
return kDefaultFlexGrow;
|
||||
}
|
||||
|
Reference in New Issue
Block a user