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