1pub fn compute() {
2 let mut taffy = taffy::Taffy::new();
3 let node0 = taffy
4 .new_node(
5 taffy::style::Style {
6 size: taffy::geometry::Size {
7 width: taffy::style::Dimension::Points(50f32),
8 height: taffy::style::Dimension::Points(50f32),
9 ..Default::default()
10 },
11 ..Default::default()
12 },
13 &[],
14 )
15 .unwrap();
16 let node10 = taffy
17 .new_node(
18 taffy::style::Style {
19 size: taffy::geometry::Size {
20 width: taffy::style::Dimension::Points(50f32),
21 height: taffy::style::Dimension::Points(10f32),
22 ..Default::default()
23 },
24 ..Default::default()
25 },
26 &[],
27 )
28 .unwrap();
29 let node1 = taffy
30 .new_node(
31 taffy::style::Style {
32 flex_direction: taffy::style::FlexDirection::Column,
33 size: taffy::geometry::Size {
34 width: taffy::style::Dimension::Points(50f32),
35 height: taffy::style::Dimension::Points(20f32),
36 ..Default::default()
37 },
38 ..Default::default()
39 },
40 &[node10],
41 )
42 .unwrap();
43 let node = taffy
44 .new_node(
45 taffy::style::Style {
46 align_items: taffy::style::AlignItems::Baseline,
47 size: taffy::geometry::Size {
48 width: taffy::style::Dimension::Points(100f32),
49 height: taffy::style::Dimension::Points(100f32),
50 ..Default::default()
51 },
52 ..Default::default()
53 },
54 &[node0, node1],
55 )
56 .unwrap();
57 taffy.compute_layout(node, taffy::geometry::Size::undefined()).unwrap();
58}