⎇ a380b58cb0418ea3728af9a67d188410c6c10f7a
benches/generated/flex_basis_flex_grow_row.rs
Ñawpa willay
Pi imata llamkarqan
ch'uya
Update all benchmarks to use the new API
1pub fn compute() {
2 let mut stretch = stretch::Stretch::new();
3 let node0 = stretch
4 .new_node(
5 stretch::style::Style {
6 flex_grow: 1f32,
7 flex_basis: stretch::style::Dimension::Points(50f32),
8 ..Default::default()
9 },
10 &[],
11 )
12 .unwrap();
13 let node1 = stretch.new_node(stretch::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap();
14 let node = stretch
15 .new_node(
16 stretch::style::Style {
17 size: stretch::geometry::Size {
18 width: stretch::style::Dimension::Points(100f32),
19 height: stretch::style::Dimension::Points(100f32),
20 ..Default::default()
21 },
22 ..Default::default()
23 },
24 &[node0, node1],
25 )
26 .unwrap();
27 stretch.compute_layout(node, stretch::geometry::Size::undefined()).unwrap();
28}