⎇ edd994fd39750e366114cf4d5a66f7092a97edfa
benches/generated/display_none_with_margin.rs
Ñawpa willay
Pi imata llamkarqan
ch'uya
1pub fn compute() {
2 let mut stretch = stretch::Stretch::new();
3 let node0 = stretch
4 .new_node(
5 stretch::style::Style {
6 display: stretch::style::Display::None,
7 size: stretch::geometry::Size {
8 width: stretch::style::Dimension::Points(20f32),
9 height: stretch::style::Dimension::Points(20f32),
10 ..Default::default()
11 },
12 margin: stretch::geometry::Rect {
13 start: stretch::style::Dimension::Points(10f32),
14 end: stretch::style::Dimension::Points(10f32),
15 top: stretch::style::Dimension::Points(10f32),
16 bottom: stretch::style::Dimension::Points(10f32),
17 ..Default::default()
18 },
19 ..Default::default()
20 },
21 vec![],
22 )
23 .unwrap();
24 let node1 = stretch.new_node(stretch::style::Style { flex_grow: 1f32, ..Default::default() }, vec![]).unwrap();
25 let node = stretch
26 .new_node(
27 stretch::style::Style {
28 size: stretch::geometry::Size {
29 width: stretch::style::Dimension::Points(100f32),
30 height: stretch::style::Dimension::Points(100f32),
31 ..Default::default()
32 },
33 ..Default::default()
34 },
35 vec![node0, node1],
36 )
37 .unwrap();
38 stretch.compute_layout(node, stretch::geometry::Size::undefined()).unwrap();
39}