gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 1090HTML 1022Markdown 12TOML 84418 Definiciones

⎇ b91874d4e34ecc9054b468a338ffcae6f61a1b4a benches/generated/align_items_stretch.rs Rust · 24 líneas · 815 B Historia Quién tocó qué crudo

Implement CSS Grid (#205) 6fd2c6bcb · Nico Burns ·

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