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:
Pritesh Nandgaonkar
2018-01-08 02:48:37 -08:00
committed by Facebook Github Bot
parent 47892c17ce
commit 40eeefd4f7
3 changed files with 23 additions and 21 deletions

View File

@@ -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;
}