Change the type of flexShrink to YGFloatOptional

Summary: Change the type of flexShrink to YGFloatOptional

Reviewed By: emilsjolander

Differential Revision: D7232171

fbshipit-source-id: 3111119d3d74a7035c01132bff61b30cf44e120a
This commit is contained in:
Pritesh Nandgaonkar
2018-03-14 04:17:16 -07:00
committed by Facebook Github Bot
parent 8aadae8ce4
commit 877c275a13
5 changed files with 26 additions and 20 deletions

View File

@@ -48,13 +48,6 @@ static void appendFloatOptionalIfDefined(
}
}
static void
appendFloatIfNotUndefined(string* base, const string key, const float num) {
if (!YGFloatIsUndefined(num)) {
appendFormatedString(base, "%s: %g; ", key.c_str(), num);
}
}
static void appendNumberIfNotUndefined(
string* base,
const string key,
@@ -162,7 +155,8 @@ void YGNodeToString(
str, "align-self: %s; ", YGAlignToString(node->getStyle().alignSelf));
}
appendFloatOptionalIfDefined(str, "flex-grow", node->getStyle().flexGrow);
appendFloatIfNotUndefined(str, "flex-shrink", node->getStyle().flexShrink);
appendFloatOptionalIfDefined(
str, "flex-shrink", node->getStyle().flexShrink);
appendNumberIfNotAuto(str, "flex-basis", node->getStyle().flexBasis);
appendFloatOptionalIfDefined(str, "flex", node->getStyle().flex);