gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 979HTML 924Markdown 12TOML 82994 Definitions

⎇ 72a1d81325e63c351a9bcbf07427e676cbe938c4 benches/generated/max_width_overrides_width.rs Rust · 21 lines · 794 B History Who touched what raw

rename stretch to stretch2 79aa44fa4 · 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(200f32),
8                    ..Default::default()
9                },
10                max_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}