tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 583HTML 275Markdown 8TOML 41586 Definitions

⎇ d67e82255da07928c7e415ea7364529d204bbaf9 benches/generated/min_width_overrides_width.rs Rust · 21 lines · 793 B History Who touched what raw

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(50f32),
8                    ..Default::default()
9                },
10                min_size: stretch2::geometry::Size {
11                    width: stretch2::style::Dimension::Points(100f32),
12                    ..Default::default()
13                },
14                ..Default::default()
15            },
16            &[],
17        )
18        .unwrap();
19    let node = stretch.new_node(stretch2::style::Style { ..Default::default() }, &[node0]).unwrap();
20    stretch.compute_layout(node, stretch2::geometry::Size::undefined()).unwrap();
21}