gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 493HTML 247TOML 5CSS 11151 Definiciones

⎇ 06471455e8cc93ab7ffee650a033ae7df8943611 benches/generated/min_width_overrides_width.rs Rust · 21 líneas · 793 B Historia Quién tocó qué crudo

Fix formatting 06471455e · 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}