⎇ a380b58cb0418ea3728af9a67d188410c6c10f7a
benches/generated/flex_grow_within_constrained_max_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 node00 = stretch
4 .new_node(
5 stretch::style::Style {
6 flex_shrink: 1f32,
7 flex_basis: stretch::style::Dimension::Points(100f32),
8 ..Default::default()
9 },
10 &[],
11 )
12 .unwrap();
13 let node01 = stretch
14 .new_node(
15 stretch::style::Style {
16 size: stretch::geometry::Size { width: stretch::style::Dimension::Points(50f32), ..Default::default() },
17 ..Default::default()
18 },
19 &[],
20 )
21 .unwrap();
22 let node0 = stretch
23 .new_node(
24 stretch::style::Style {
25 size: stretch::geometry::Size {
26 height: stretch::style::Dimension::Points(100f32),
27 ..Default::default()
28 },
29 max_size: stretch::geometry::Size {
30 width: stretch::style::Dimension::Points(100f32),
31 ..Default::default()
32 },
33 ..Default::default()
34 },
35 &[node00, node01],
36 )
37 .unwrap();
38 let node = stretch
39 .new_node(
40 stretch::style::Style {
41 flex_direction: stretch::style::FlexDirection::Column,
42 size: stretch::geometry::Size {
43 width: stretch::style::Dimension::Points(200f32),
44 ..Default::default()
45 },
46 ..Default::default()
47 },
48 &[node0],
49 )
50 .unwrap();
51 stretch.compute_layout(node, stretch::geometry::Size::undefined()).unwrap();
52}