Fix setter and getter of margin, position, border and padding

Summary:
This diff fixes the setter and getter of margin, position, border and padding to the previous behaviour of yoga, before floatoptional change

This diff also removes the unrequired `#define`

Reviewed By: emilsjolander

Differential Revision: D7274115

fbshipit-source-id: 942a91e6562ef789ae79102a828f397889468fa7
This commit is contained in:
Pritesh Nandgaonkar
2018-03-15 07:13:02 -07:00
committed by Facebook Github Bot
parent cfb9eeca20
commit 369c9ad12a
2 changed files with 13 additions and 26 deletions

View File

@@ -72,7 +72,10 @@ appendNumberIfNotAuto(string* base, const string& key, const YGValue number) {
static void
appendNumberIfNotZero(string* base, const string& str, const YGValue number) {
if (!YGFloatsEqual(number.value, 0)) {
if (number.unit == YGUnitAuto) {
base->append(str + ": auto; ");
} else if (!YGFloatsEqual(number.value, 0)) {
appendNumberIfNotUndefined(base, str, number);
}
}