tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

HTML 5544Rust 88Markdown 11TOML 91926 Definiciones

⎇ bf3dfaec9e387a7e67408fc78ca869d7eaaa8e1f benches/generated/wrap_child.rs Rust · 21 líneas · 717 B Historia Quién tocó qué crudo

Import yoga tests (#320) e05b9093d · 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 {
8                width: taffy::style::Dimension::Points(100f32),
9                height: taffy::style::Dimension::Points(100f32),
10            },
11            ..Default::default()
12        })
13        .unwrap();
14    let node = taffy
15        .new_with_children(
16            taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, ..Default::default() },
17            &[node0],
18        )
19        .unwrap();
20    taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
21}