bottom styling isn't applied when a View is not absolute-positioned

Summary: The new CSSLayout have a wrong calculate for the getRelativePosition. So use the getLeadingPosition will get 0 instead of return undefined. Fix it with using isLeadingPosDefined.

Reviewed By: fkgozali

Differential Revision: D3640799

fbshipit-source-id: 50d3bd2ea4c0d8bf96ba34297425ba269b0535cd
This commit is contained in:
Mengjue Wang 2016-07-28 23:36:20 -07:00 committed by Facebook Github Bot 4
parent 66514869aa
commit a06e4b75e4
1 changed files with 2 additions and 3 deletions

View File

@ -700,9 +700,8 @@ static void setTrailingPosition(CSSNode* node, CSSNode* child, CSSFlexDirection
// If both left and right are defined, then use left. Otherwise return
// +left or -right depending on which is defined.
static float getRelativePosition(CSSNode* node, CSSFlexDirection axis) {
float lead = getLeadingPosition(node, axis);
if (!isUndefined(lead)) {
return lead;
if (isLeadingPosDefined(node, axis)) {
return getLeadingPosition(node, axis);
}
return -getTrailingPosition(node, axis);
}