tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

HTML 231Rust 9TOML 3CSS 1345 Sutichaykuna

⎇ a380b58cb0418ea3728af9a67d188410c6c10f7a benches/generated/justify_content_column_min_height_and_margin_bottom.rs Rust · 35 siq'ikuna · 1.2 KB Ñawpa willay Pi imata llamkarqan ch'uya

Update all benchmarks to use the new API a380b58cb · David Flemström ·

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                    bottom: stretch::style::Dimension::Points(10f32),
13                    ..Default::default()
14                },
15                ..Default::default()
16            },
17            &[],
18        )
19        .unwrap();
20    let node = stretch
21        .new_node(
22            stretch::style::Style {
23                flex_direction: stretch::style::FlexDirection::Column,
24                justify_content: stretch::style::JustifyContent::Center,
25                min_size: stretch::geometry::Size {
26                    height: stretch::style::Dimension::Points(50f32),
27                    ..Default::default()
28                },
29                ..Default::default()
30            },
31            &[node0],
32        )
33        .unwrap();
34    stretch.compute_layout(node, stretch::geometry::Size::undefined()).unwrap();
35}