Fix width being ignored when has a value of 0

Summary: 8f6a96adbc added a test in isDimDefined that checks if `value > 0.0`, but unfortunately, it did not faithfully port the JavaScript version which is `value >= 0.0`: https://github.com/facebook/css-layout/blob/master/src/Layout.js#L306. Sadly, no test covered this so it went unnoticed.
Closes https://github.com/facebook/css-layout/pull/134

Reviewed By: @​svcscm

Differential Revision: D2481773

Pulled By: @vjeux
This commit is contained in:
Christopher Chedeau
2015-09-25 15:38:59 -07:00
committed by facebook-github-bot-8
parent 656126a2f1
commit bd36e40258
2 changed files with 10 additions and 10 deletions

View File

@@ -451,7 +451,7 @@ static float getDimWithMargin(css_node_t *node, css_flex_direction_t axis) {
static bool isDimDefined(css_node_t *node, css_flex_direction_t axis) {
float value = node->style.dimensions[dim[axis]];
return !isUndefined(value) && value > 0.0;
return !isUndefined(value) && value >= 0.0;
}
static bool isPosDefined(css_node_t *node, css_position_t position) {