tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 707HTML 660Markdown 12TOML 62344 Definiciones

⎇ b91874d4e34ecc9054b468a338ffcae6f61a1b4a benches/generated/padding_no_child.rs Rust · 17 líneas · 657 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 node = taffy
6        .new_leaf(taffy::style::Style {
7            padding: taffy::geometry::Rect {
8                left: taffy::style::LengthPercentage::Points(10f32),
9                right: taffy::style::LengthPercentage::Points(10f32),
10                top: taffy::style::LengthPercentage::Points(10f32),
11                bottom: taffy::style::LengthPercentage::Points(10f32),
12            },
13            ..Default::default()
14        })
15        .unwrap();
16    taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
17}