tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 707HTML 660Markdown 12TOML 62344 Sutichaykuna

⎇ a380b58cb0418ea3728af9a67d188410c6c10f7a benches/generated/flex_basis_flex_shrink_row.rs Rust · 29 siq'ikuna · 993 B Ñawpa willay Pi imata llamkarqan ch'uya

Update all benchmarks to use the new API a380b58cb · David Flemström ·

1pub fn compute() {
2    let mut stretch = stretch::Stretch::new();
3    let node0 = stretch
4        .new_node(
5            stretch::style::Style { flex_basis: stretch::style::Dimension::Points(100f32), ..Default::default() },
6            &[],
7        )
8        .unwrap();
9    let node1 = stretch
10        .new_node(
11            stretch::style::Style { flex_basis: stretch::style::Dimension::Points(50f32), ..Default::default() },
12            &[],
13        )
14        .unwrap();
15    let node = stretch
16        .new_node(
17            stretch::style::Style {
18                size: stretch::geometry::Size {
19                    width: stretch::style::Dimension::Points(100f32),
20                    height: stretch::style::Dimension::Points(100f32),
21                    ..Default::default()
22                },
23                ..Default::default()
24            },
25            &[node0, node1],
26        )
27        .unwrap();
28    stretch.compute_layout(node, stretch::geometry::Size::undefined()).unwrap();
29}