tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 707HTML 660Markdown 12TOML 62344 Definiciones

⎇ a380b58cb0418ea3728af9a67d188410c6c10f7a benches/generated/flex_basis_larger_than_content_row.rs Rust · 39 líneas · 1.2 KB Historia Quién tocó qué crudo

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

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