⎇ a380b58cb0418ea3728af9a67d188410c6c10f7a
benches/generated/absolute_layout_width_height_end_bottom.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 position_type: stretch::style::PositionType::Absolute,
7 size: stretch::geometry::Size {
8 width: stretch::style::Dimension::Points(10f32),
9 height: stretch::style::Dimension::Points(10f32),
10 ..Default::default()
11 },
12 position: stretch::geometry::Rect {
13 end: stretch::style::Dimension::Points(10f32),
14 bottom: stretch::style::Dimension::Points(10f32),
15 ..Default::default()
16 },
17 ..Default::default()
18 },
19 &[],
20 )
21 .unwrap();
22 let node = stretch
23 .new_node(
24 stretch::style::Style {
25 size: stretch::geometry::Size {
26 width: stretch::style::Dimension::Points(100f32),
27 height: stretch::style::Dimension::Points(100f32),
28 ..Default::default()
29 },
30 ..Default::default()
31 },
32 &[node0],
33 )
34 .unwrap();
35 stretch.compute_layout(node, stretch::geometry::Size::undefined()).unwrap();
36}