gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 717HTML 669Markdown 12TOML 62373 Definiciones

⎇ 0.2.x benches/generated/flex_grow_shrink_at_most.rs Rust · 21 líneas · 831 B Historia Quién tocó qué crudo

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

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