gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 1108HTML 1039Markdown 12TOML 74481 Definitions

⎇ 9f42ca4a0d99e501f16c3148bd1caf12b37b2ac5 benches/generated/display_none.rs Rust · 24 lines · 914 B History Who touched what raw

Update benches to API changes 9f42ca4a0 · msiglreith ·

1pub fn compute() {
2    let mut stretch = stretch::Stretch::new();
3    let node0 = stretch.new_node(stretch::style::Style { flex_grow: 1f32, ..Default::default() }, vec![]).unwrap();
4    let node1 = stretch
5        .new_node(
6            stretch::style::Style { display: stretch::style::Display::None, flex_grow: 1f32, ..Default::default() },
7            vec![],
8        )
9        .unwrap();
10    let node = stretch
11        .new_node(
12            stretch::style::Style {
13                size: stretch::geometry::Size {
14                    width: stretch::style::Dimension::Points(100f32),
15                    height: stretch::style::Dimension::Points(100f32),
16                    ..Default::default()
17                },
18                ..Default::default()
19            },
20            vec![node0, node1],
21        )
22        .unwrap();
23    stretch.compute_layout(node, stretch::geometry::Size::undefined()).unwrap();
24}