gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 499HTML 238Markdown 7TOML 31441 Definitions

⎇ 0.2.x benches/generated/align_flex_start_with_shrinking_children_with_stretch.rs Rust · 29 lines · 1.1 KB History Who touched what raw

Rename FlexboxLayout back to Style (#251) 49893a7d9 · Nico Burns ·

1pub fn compute() {
2    let mut taffy = taffy::Taffy::new();
3    let node000 = taffy
4        .new_with_children(taffy::style::Style { flex_grow: 1f32, flex_shrink: 1f32, ..Default::default() }, &[])
5        .unwrap();
6    let node00 = taffy
7        .new_with_children(taffy::style::Style { flex_grow: 1f32, flex_shrink: 1f32, ..Default::default() }, &[node000])
8        .unwrap();
9    let node0 = taffy
10        .new_with_children(
11            taffy::style::Style { align_items: taffy::style::AlignItems::FlexStart, ..Default::default() },
12            &[node00],
13        )
14        .unwrap();
15    let node = taffy
16        .new_with_children(
17            taffy::style::Style {
18                size: taffy::geometry::Size {
19                    width: taffy::style::Dimension::Points(500f32),
20                    height: taffy::style::Dimension::Points(500f32),
21                    ..Default::default()
22                },
23                ..Default::default()
24            },
25            &[node0],
26        )
27        .unwrap();
28    taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
29}