tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 583HTML 275Markdown 8TOML 41586 Definitions

⎇ edd994fd39750e366114cf4d5a66f7092a97edfa benches/generated/justify_content_row_min_width_and_margin.rs Rust · 34 lines · 1.2 KB History Who touched what raw

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                size: stretch::geometry::Size {
7                    width: stretch::style::Dimension::Points(20f32),
8                    height: stretch::style::Dimension::Points(20f32),
9                    ..Default::default()
10                },
11                margin: stretch::geometry::Rect {
12                    start: stretch::style::Dimension::Points(10f32),
13                    ..Default::default()
14                },
15                ..Default::default()
16            },
17            vec![],
18        )
19        .unwrap();
20    let node = stretch
21        .new_node(
22            stretch::style::Style {
23                justify_content: stretch::style::JustifyContent::Center,
24                min_size: stretch::geometry::Size {
25                    width: stretch::style::Dimension::Points(50f32),
26                    ..Default::default()
27                },
28                ..Default::default()
29            },
30            vec![node0],
31        )
32        .unwrap();
33    stretch.compute_layout(node, stretch::geometry::Size::undefined()).unwrap();
34}