gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 1061HTML 997Markdown 12TOML 83120 Sutichaykuna

⎇ 0.2.x benches/generated/align_flex_start_with_stretching_children.rs Rust · 24 siq'ikuna · 995 B Ñawpa willay Pi imata llamkarqan ch'uya

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.new_with_children(taffy::style::Style { ..Default::default() }, &[node00]).unwrap();
10    let node = taffy
11        .new_with_children(
12            taffy::style::Style {
13                size: taffy::geometry::Size {
14                    width: taffy::style::Dimension::Points(500f32),
15                    height: taffy::style::Dimension::Points(500f32),
16                    ..Default::default()
17                },
18                ..Default::default()
19            },
20            &[node0],
21        )
22        .unwrap();
23    taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
24}