Initial implementation of flexWrap

This commit is contained in:
Christopher Chedeau
2014-12-12 12:03:31 +00:00
parent 28243156e4
commit 10fb645777
12 changed files with 930 additions and 607 deletions

View File

@@ -3671,6 +3671,59 @@ int main()
test("should layout with children of a contain with left", root_node, root_layout);
}
{
css_node_t *root_node = new_test_css_node();
{
css_node_t *node_0 = root_node;
node_0->style.flex_direction = CSS_FLEX_DIRECTION_ROW;
node_0->style.flex_wrap = CSS_WRAP;
node_0->style.dimensions[CSS_WIDTH] = 100;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->style.dimensions[CSS_WIDTH] = 40;
node_1->style.dimensions[CSS_HEIGHT] = 10;
node_1 = node_0->get_child(node_0->context, 1);
node_1->style.dimensions[CSS_WIDTH] = 40;
node_1->style.dimensions[CSS_HEIGHT] = 10;
node_1 = node_0->get_child(node_0->context, 2);
node_1->style.dimensions[CSS_WIDTH] = 40;
node_1->style.dimensions[CSS_HEIGHT] = 10;
}
}
css_node_t *root_layout = new_test_css_node();
{
css_node_t *node_0 = root_layout;
node_0->layout.position[CSS_TOP] = 0;
node_0->layout.position[CSS_LEFT] = 0;
node_0->layout.dimensions[CSS_WIDTH] = 100;
node_0->layout.dimensions[CSS_HEIGHT] = 20;
init_css_node_children(node_0, 3);
{
css_node_t *node_1;
node_1 = node_0->get_child(node_0->context, 0);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 40;
node_1->layout.dimensions[CSS_HEIGHT] = 10;
node_1 = node_0->get_child(node_0->context, 1);
node_1->layout.position[CSS_TOP] = 0;
node_1->layout.position[CSS_LEFT] = 40;
node_1->layout.dimensions[CSS_WIDTH] = 40;
node_1->layout.dimensions[CSS_HEIGHT] = 10;
node_1 = node_0->get_child(node_0->context, 2);
node_1->layout.position[CSS_TOP] = 10;
node_1->layout.position[CSS_LEFT] = 0;
node_1->layout.dimensions[CSS_WIDTH] = 40;
node_1->layout.dimensions[CSS_HEIGHT] = 10;
}
}
test("should layout flex-wrap", root_node, root_layout);
}
/** END_GENERATED **/
return tests_finished();
}