gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 1076HTML 1008Markdown 12TOML 83208 Definiciones

⎇ d8c8bb472833ba92d694a9420e4c5bd8308e32e3 benches/generated/min_width_overrides_width_on_root.rs Rust · 16 líneas · 603 B Historia Quién tocó qué crudo

Strict types for style values (#269) 0d8c198a9 · Nico Burns ·

1pub fn compute() {
2    #[allow(unused_imports)]
3    use taffy::prelude::*;
4    let mut taffy = taffy::Taffy::new();
5    let node = taffy
6        .new_with_children(
7            taffy::style::Style {
8                size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Size::auto() },
9                min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(100f32), ..Size::auto() },
10                ..Default::default()
11            },
12            &[],
13        )
14        .unwrap();
15    taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
16}