tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

HTML 231Rust 9TOML 3CSS 1345 Sutichaykuna

⎇ d67e82255da07928c7e415ea7364529d204bbaf9 benches/generated/flex_direction_row_no_width.rs Rust · 52 siq'ikuna · 1.6 KB Ñawpa willay Pi imata llamkarqan ch'uya

Fix formatting d67e82255 · elbaro ·

1pub fn compute() {
2    let mut stretch = stretch2::Stretch::new();
3    let node0 = stretch
4        .new_node(
5            stretch2::style::Style {
6                size: stretch2::geometry::Size {
7                    width: stretch2::style::Dimension::Points(10f32),
8                    ..Default::default()
9                },
10                ..Default::default()
11            },
12            &[],
13        )
14        .unwrap();
15    let node1 = stretch
16        .new_node(
17            stretch2::style::Style {
18                size: stretch2::geometry::Size {
19                    width: stretch2::style::Dimension::Points(10f32),
20                    ..Default::default()
21                },
22                ..Default::default()
23            },
24            &[],
25        )
26        .unwrap();
27    let node2 = stretch
28        .new_node(
29            stretch2::style::Style {
30                size: stretch2::geometry::Size {
31                    width: stretch2::style::Dimension::Points(10f32),
32                    ..Default::default()
33                },
34                ..Default::default()
35            },
36            &[],
37        )
38        .unwrap();
39    let node = stretch
40        .new_node(
41            stretch2::style::Style {
42                size: stretch2::geometry::Size {
43                    height: stretch2::style::Dimension::Points(100f32),
44                    ..Default::default()
45                },
46                ..Default::default()
47            },
48            &[node0, node1, node2],
49        )
50        .unwrap();
51    stretch.compute_layout(node, stretch2::geometry::Size::undefined()).unwrap();
52}