gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 1111HTML 1039Markdown 12TOML 94524 Definitions

⎇ 9f42ca4a0d99e501f16c3148bd1caf12b37b2ac5 benches/generated/absolute_layout_width_height_start_top.rs Rust · 36 lines · 1.3 KB 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
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                    top: stretch::style::Dimension::Points(10f32),
15                    ..Default::default()
16                },
17                ..Default::default()
18            },
19            vec![],
20        )
21        .unwrap();
22    let node = stretch
23        .new_node(
24            stretch::style::Style {
25                size: stretch::geometry::Size {
26                    width: stretch::style::Dimension::Points(100f32),
27                    height: stretch::style::Dimension::Points(100f32),
28                    ..Default::default()
29                },
30                ..Default::default()
31            },
32            vec![node0],
33        )
34        .unwrap();
35    stretch.compute_layout(node, stretch::geometry::Size::undefined()).unwrap();
36}