diff --git a/src/Layout.c b/src/Layout.c index cbbb4c32b6..51888b9f65 100644 --- a/src/Layout.c +++ b/src/Layout.c @@ -431,7 +431,9 @@ static void layoutNodeImpl(css_node_t *node, float parentMaxWidth) { getPaddingAndBorderAxis(node, CSS_FLEX_DIRECTION_COLUMN); } } - return; + if (node->children_count == 0) { + return; + } } int i; diff --git a/src/Layout.js b/src/Layout.js index fd39b4fb03..315f9bcac7 100755 --- a/src/Layout.js +++ b/src/Layout.js @@ -315,7 +315,9 @@ var computeLayout = (function() { getPaddingAndBorderAxis(node, CSS_FLEX_DIRECTION_COLUMN); } } - return; + if (node.children.length === 0) { + return; + } } var/*int*/ i; diff --git a/src/java/src/com/facebook/csslayout/LayoutEngine.java b/src/java/src/com/facebook/csslayout/LayoutEngine.java index 01ee44d03c..7fe74cc582 100644 --- a/src/java/src/com/facebook/csslayout/LayoutEngine.java +++ b/src/java/src/com/facebook/csslayout/LayoutEngine.java @@ -369,7 +369,9 @@ private static void layoutNodeImpl( getPaddingAndBorderAxis(node, CSSFlexDirection.COLUMN); } } - return; + if (node.getChildCount() == 0) { + return; + } } int i;