tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 583HTML 275Markdown 8TOML 41586 Sutichaykuna

⎇ 0.1.x benches/generated/nested_overflowing_child_in_constraint_parent.rs Rust · 43 siq'ikuna · 1.4 KB Ñawpa willay Pi imata llamkarqan ch'uya

Rename sprawl to taffy (#134) 8936790d6 · Alice Cecile ·

1pub fn compute() {
2    let mut taffy = taffy::Taffy::new();
3    let node00 = taffy
4        .new_node(
5            taffy::style::Style {
6                size: taffy::geometry::Size {
7                    width: taffy::style::Dimension::Points(200f32),
8                    height: taffy::style::Dimension::Points(200f32),
9                    ..Default::default()
10                },
11                ..Default::default()
12            },
13            &[],
14        )
15        .unwrap();
16    let node0 = taffy
17        .new_node(
18            taffy::style::Style {
19                size: taffy::geometry::Size {
20                    width: taffy::style::Dimension::Points(100f32),
21                    height: taffy::style::Dimension::Points(100f32),
22                    ..Default::default()
23                },
24                ..Default::default()
25            },
26            &[node00],
27        )
28        .unwrap();
29    let node = taffy
30        .new_node(
31            taffy::style::Style {
32                size: taffy::geometry::Size {
33                    width: taffy::style::Dimension::Points(100f32),
34                    height: taffy::style::Dimension::Points(100f32),
35                    ..Default::default()
36                },
37                ..Default::default()
38            },
39            &[node0],
40        )
41        .unwrap();
42    taffy.compute_layout(node, taffy::geometry::Size::undefined()).unwrap();
43}