gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 788HTML 740Markdown 12TOML 62536 Definitions

⎇ 0.2.x benches/generated/display_none.rs Rust · 24 lines · 902 B 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 node0 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap();
4    let node1 = taffy
5        .new_with_children(
6            taffy::style::Style { display: taffy::style::Display::None, flex_grow: 1f32, ..Default::default() },
7            &[],
8        )
9        .unwrap();
10    let node = taffy
11        .new_with_children(
12            taffy::style::Style {
13                size: taffy::geometry::Size {
14                    width: taffy::style::Dimension::Points(100f32),
15                    height: taffy::style::Dimension::Points(100f32),
16                    ..Default::default()
17                },
18                ..Default::default()
19            },
20            &[node0, node1],
21        )
22        .unwrap();
23    taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
24}