Move YGNodeResolveFlexShrink to a method on YGNode
Summary: Move YGNodeResolveFlexShrink to a method on YGNode Reviewed By: emilsjolander Differential Revision: D6611418 fbshipit-source-id: 6e5ba39b555d313a967800589891027920112c15
This commit is contained in:
committed by
Facebook Github Bot
parent
40eeefd4f7
commit
348dd368b5
@@ -435,3 +435,17 @@ float YGNode::resolveFlexGrow() {
|
||||
}
|
||||
return kDefaultFlexGrow;
|
||||
}
|
||||
|
||||
float YGNode::resolveFlexShrink() {
|
||||
if (parent_ == nullptr) {
|
||||
return 0.0;
|
||||
}
|
||||
if (!YGFloatIsUndefined(style_.flexShrink)) {
|
||||
return style_.flexShrink;
|
||||
}
|
||||
if (!config_->useWebDefaults && !YGFloatIsUndefined(style_.flex) &&
|
||||
style_.flex < 0.0f) {
|
||||
return -style_.flex;
|
||||
}
|
||||
return config_->useWebDefaults ? kWebDefaultFlexShrink : kDefaultFlexShrink;
|
||||
}
|
||||
|
Reference in New Issue
Block a user