Remove the usage of YGUndefined in the default values of Border in YGStyle

Summary: Remove the usage of YGUndefined in the default values of Border in YGStyle. In the getter of Border function, YGUndefined is used just to keep it logically consistent. The proper solution would be to change the api in `Yoga.h` to accept `YGFloatOptional`, but that would require to change lot of the code in client of this library. Will make a separate diff for that.

Reviewed By: emilsjolander

Differential Revision: D7195115

fbshipit-source-id: e635cf55ac94d8a90caef6cafce281579da2cbfc
This commit is contained in:
Pritesh Nandgaonkar
2018-03-14 04:17:05 -07:00
committed by Facebook Github Bot
parent c75adb0671
commit 47ad3f63cf
5 changed files with 42 additions and 2 deletions

View File

@@ -49,3 +49,7 @@ bool YGFloatsEqual(const float a, const float b) {
}
return YGFloatIsUndefined(a) && YGFloatIsUndefined(b);
}
float YGFloatSanitize(const float& val) {
return YGFloatIsUndefined(val) ? 0 : val;
}