tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 583HTML 275Markdown 8TOML 41586 Definiciones

⎇ edd994fd39750e366114cf4d5a66f7092a97edfa benches/generated/absolute_layout_width_height_start_top_end_bottom.rs Rust · 38 líneas · 1.4 KB Historia Quién tocó qué crudo

Update benches to API changes edd994fd3 · msiglreith ·

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