initial support for text layout

This commit is contained in:
Christopher Chedeau
2014-04-26 12:16:27 -07:00
parent 6fdd724820
commit c06f48c45f
5 changed files with 21 additions and 4 deletions

View File

@@ -231,6 +231,11 @@ var computeLayout = (function() {
node.layout[leading[crossAxis]] += getMargin(node, leading[crossAxis]) +
getRelativePosition(node, crossAxis);
if ('text' in node.style) {
node.layout.width = 36;
node.layout.height = 18;
return;
}
// <Loop A> Layout non flexible children and count children by type
@@ -272,6 +277,7 @@ var computeLayout = (function() {
}
}
// <Loop B> Layout flexible children and allocate empty space
// In order to position the elements in the main axis, we have two