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