⎇ a380b58cb0418ea3728af9a67d188410c6c10f7a
benches/generated/margin_and_stretch_column.rs
Historia
Quién tocó qué
crudo
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 margin: stretch::geometry::Rect {
8 start: stretch::style::Dimension::Points(10f32),
9 end: stretch::style::Dimension::Points(10f32),
10 ..Default::default()
11 },
12 ..Default::default()
13 },
14 &[],
15 )
16 .unwrap();
17 let node = stretch
18 .new_node(
19 stretch::style::Style {
20 flex_direction: stretch::style::FlexDirection::Column,
21 size: stretch::geometry::Size {
22 width: stretch::style::Dimension::Points(100f32),
23 height: stretch::style::Dimension::Points(100f32),
24 ..Default::default()
25 },
26 ..Default::default()
27 },
28 &[node0],
29 )
30 .unwrap();
31 stretch.compute_layout(node, stretch::geometry::Size::undefined()).unwrap();
32}