1pub fn compute() {
2 let mut taffy = taffy::Taffy::new();
3 let node0 = taffy
4 .new_node(
5 taffy::style::Style {
6 display: taffy::style::Display::None,
7 size: taffy::geometry::Size {
8 width: taffy::style::Dimension::Points(20f32),
9 height: taffy::style::Dimension::Points(20f32),
10 ..Default::default()
11 },
12 margin: taffy::geometry::Rect {
13 start: taffy::style::Dimension::Points(10f32),
14 end: taffy::style::Dimension::Points(10f32),
15 top: taffy::style::Dimension::Points(10f32),
16 bottom: taffy::style::Dimension::Points(10f32),
17 ..Default::default()
18 },
19 ..Default::default()
20 },
21 &[],
22 )
23 .unwrap();
24 let node1 = taffy.new_node(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap();
25 let node = taffy
26 .new_node(
27 taffy::style::Style {
28 size: taffy::geometry::Size {
29 width: taffy::style::Dimension::Points(100f32),
30 height: taffy::style::Dimension::Points(100f32),
31 ..Default::default()
32 },
33 ..Default::default()
34 },
35 &[node0, node1],
36 )
37 .unwrap();
38 taffy.compute_layout(node, taffy::geometry::Size::undefined()).unwrap();
39}