tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 497HTML 254C 19JavaScript 81329 Definiciones

⎇ 0.1.x benches/generated/absolute_layout_start_top_end_bottom.rs Rust · 33 líneas · 1.1 KB Historia Quién tocó qué crudo

Rename sprawl to taffy (#134) 8936790d6 · Alice Cecile ·

1pub fn compute() {
2    let mut taffy = taffy::Taffy::new();
3    let node0 = taffy
4        .new_node(
5            taffy::style::Style {
6                position_type: taffy::style::PositionType::Absolute,
7                position: taffy::geometry::Rect {
8                    start: taffy::style::Dimension::Points(10f32),
9                    end: taffy::style::Dimension::Points(10f32),
10                    top: taffy::style::Dimension::Points(10f32),
11                    bottom: taffy::style::Dimension::Points(10f32),
12                    ..Default::default()
13                },
14                ..Default::default()
15            },
16            &[],
17        )
18        .unwrap();
19    let node = taffy
20        .new_node(
21            taffy::style::Style {
22                size: taffy::geometry::Size {
23                    width: taffy::style::Dimension::Points(100f32),
24                    height: taffy::style::Dimension::Points(100f32),
25                    ..Default::default()
26                },
27                ..Default::default()
28            },
29            &[node0],
30        )
31        .unwrap();
32    taffy.compute_layout(node, taffy::geometry::Size::undefined()).unwrap();
33}