gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

HTML 231Rust 8TOML 3CSS 1317 Definiciones

⎇ 0.2.x benches/generated/absolute_layout_no_size.rs Rust · 23 líneas · 775 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 node0 = taffy
4        .new_with_children(
5            taffy::style::Style { position_type: taffy::style::PositionType::Absolute, ..Default::default() },
6            &[],
7        )
8        .unwrap();
9    let node = taffy
10        .new_with_children(
11            taffy::style::Style {
12                size: taffy::geometry::Size {
13                    width: taffy::style::Dimension::Points(100f32),
14                    height: taffy::style::Dimension::Points(100f32),
15                    ..Default::default()
16                },
17                ..Default::default()
18            },
19            &[node0],
20        )
21        .unwrap();
22    taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
23}