⎇ a380b58cb0418ea3728af9a67d188410c6c10f7a
benches/generated/margin_auto_left_and_right_column.rs
History
Who touched what
raw
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 size: stretch::geometry::Size {
7 width: stretch::style::Dimension::Points(50f32),
8 height: stretch::style::Dimension::Points(50f32),
9 ..Default::default()
10 },
11 margin: stretch::geometry::Rect {
12 start: stretch::style::Dimension::Auto,
13 end: stretch::style::Dimension::Auto,
14 ..Default::default()
15 },
16 ..Default::default()
17 },
18 &[],
19 )
20 .unwrap();
21 let node1 = stretch
22 .new_node(
23 stretch::style::Style {
24 size: stretch::geometry::Size {
25 width: stretch::style::Dimension::Points(50f32),
26 height: stretch::style::Dimension::Points(50f32),
27 ..Default::default()
28 },
29 ..Default::default()
30 },
31 &[],
32 )
33 .unwrap();
34 let node = stretch
35 .new_node(
36 stretch::style::Style {
37 align_items: stretch::style::AlignItems::Center,
38 size: stretch::geometry::Size {
39 width: stretch::style::Dimension::Points(200f32),
40 height: stretch::style::Dimension::Points(200f32),
41 ..Default::default()
42 },
43 ..Default::default()
44 },
45 &[node0, node1],
46 )
47 .unwrap();
48 stretch.compute_layout(node, stretch::geometry::Size::undefined()).unwrap();
49}