tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 583HTML 275Markdown 8TOML 41586 Sutichaykuna

⎇ a380b58cb0418ea3728af9a67d188410c6c10f7a benches/generated/max_width_overrides_width.rs Rust · 21 siq'ikuna · 786 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 {
6                size: stretch::geometry::Size {
7                    width: stretch::style::Dimension::Points(200f32),
8                    ..Default::default()
9                },
10                max_size: stretch::geometry::Size {
11                    width: stretch::style::Dimension::Points(100f32),
12                    ..Default::default()
13                },
14                ..Default::default()
15            },
16            &[],
17        )
18        .unwrap();
19    let node = stretch.new_node(stretch::style::Style { ..Default::default() }, &[node0]).unwrap();
20    stretch.compute_layout(node, stretch::geometry::Size::undefined()).unwrap();
21}