tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

HTML 231Rust 9TOML 3CSS 1345 Sutichaykuna

⎇ edd994fd39750e366114cf4d5a66f7092a97edfa benches/generated/flex_direction_row.rs Rust · 44 siq'ikuna · 1.5 KB Ñawpa willay Pi imata llamkarqan ch'uya

Update benches to API changes edd994fd3 · msiglreith ·

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 { width: stretch::style::Dimension::Points(10f32), ..Default::default() },
7                ..Default::default()
8            },
9            vec![],
10        )
11        .unwrap();
12    let node1 = stretch
13        .new_node(
14            stretch::style::Style {
15                size: stretch::geometry::Size { width: stretch::style::Dimension::Points(10f32), ..Default::default() },
16                ..Default::default()
17            },
18            vec![],
19        )
20        .unwrap();
21    let node2 = stretch
22        .new_node(
23            stretch::style::Style {
24                size: stretch::geometry::Size { width: stretch::style::Dimension::Points(10f32), ..Default::default() },
25                ..Default::default()
26            },
27            vec![],
28        )
29        .unwrap();
30    let node = stretch
31        .new_node(
32            stretch::style::Style {
33                size: stretch::geometry::Size {
34                    width: stretch::style::Dimension::Points(100f32),
35                    height: stretch::style::Dimension::Points(100f32),
36                    ..Default::default()
37                },
38                ..Default::default()
39            },
40            vec![node0, node1, node2],
41        )
42        .unwrap();
43    stretch.compute_layout(node, stretch::geometry::Size::undefined()).unwrap();
44}