tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 1085HTML 1017Markdown 12TOML 84234 Definiciones

⎇ a380b58cb0418ea3728af9a67d188410c6c10f7a benches/generated/margin_left.rs Rust · 30 líneas · 1.0 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 node0 = stretch
4        .new_node(
5            stretch::style::Style {
6                size: stretch::geometry::Size { width: stretch::style::Dimension::Points(10f32), ..Default::default() },
7                margin: stretch::geometry::Rect {
8                    start: stretch::style::Dimension::Points(10f32),
9                    ..Default::default()
10                },
11                ..Default::default()
12            },
13            &[],
14        )
15        .unwrap();
16    let node = stretch
17        .new_node(
18            stretch::style::Style {
19                size: stretch::geometry::Size {
20                    width: stretch::style::Dimension::Points(100f32),
21                    height: stretch::style::Dimension::Points(100f32),
22                    ..Default::default()
23                },
24                ..Default::default()
25            },
26            &[node0],
27        )
28        .unwrap();
29    stretch.compute_layout(node, stretch::geometry::Size::undefined()).unwrap();
30}