tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

HTML 231Rust 9TOML 3CSS 1345 Definiciones

⎇ 0.1.x benches/generated/flex_basis_smaller_than_content_column.rs Rust · 37 líneas · 1.2 KB Historia Quién tocó qué crudo

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(100f32),
8                    height: taffy::style::Dimension::Points(100f32),
9                    ..Default::default()
10                },
11                ..Default::default()
12            },
13            &[],
14        )
15        .unwrap();
16    let node0 = taffy
17        .new_node(
18            taffy::style::Style {
19                flex_direction: taffy::style::FlexDirection::Column,
20                flex_basis: taffy::style::Dimension::Points(50f32),
21                ..Default::default()
22            },
23            &[node00],
24        )
25        .unwrap();
26    let node = taffy
27        .new_node(
28            taffy::style::Style {
29                flex_direction: taffy::style::FlexDirection::Column,
30                size: taffy::geometry::Size { height: taffy::style::Dimension::Points(100f32), ..Default::default() },
31                ..Default::default()
32            },
33            &[node0],
34        )
35        .unwrap();
36    taffy.compute_layout(node, taffy::geometry::Size::undefined()).unwrap();
37}