gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 1068HTML 999Markdown 12TOML 83187 Definitions

⎇ 9f42ca4a0d99e501f16c3148bd1caf12b37b2ac5 benches/generated/flex_direction_column_reverse.rs Rust · 54 lines · 1.7 KB History Who touched what raw

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                size: stretch::geometry::Size {
7                    height: stretch::style::Dimension::Points(10f32),
8                    ..Default::default()
9                },
10                ..Default::default()
11            },
12            vec![],
13        )
14        .unwrap();
15    let node1 = stretch
16        .new_node(
17            stretch::style::Style {
18                size: stretch::geometry::Size {
19                    height: stretch::style::Dimension::Points(10f32),
20                    ..Default::default()
21                },
22                ..Default::default()
23            },
24            vec![],
25        )
26        .unwrap();
27    let node2 = stretch
28        .new_node(
29            stretch::style::Style {
30                size: stretch::geometry::Size {
31                    height: stretch::style::Dimension::Points(10f32),
32                    ..Default::default()
33                },
34                ..Default::default()
35            },
36            vec![],
37        )
38        .unwrap();
39    let node = stretch
40        .new_node(
41            stretch::style::Style {
42                flex_direction: stretch::style::FlexDirection::ColumnReverse,
43                size: stretch::geometry::Size {
44                    width: stretch::style::Dimension::Points(100f32),
45                    height: stretch::style::Dimension::Points(100f32),
46                    ..Default::default()
47                },
48                ..Default::default()
49            },
50            vec![node0, node1, node2],
51        )
52        .unwrap();
53    stretch.compute_layout(node, stretch::geometry::Size::undefined()).unwrap();
54}