gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 499HTML 254C 19JavaScript 81371 Definiciones

⎇ 9f42ca4a0d99e501f16c3148bd1caf12b37b2ac5 benches/generated/margin_with_sibling_column.rs Rust · 32 líneas · 1.1 KB Historia Quién tocó qué crudo

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