gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 1118HTML 1044Markdown 12TOML 94787 Definiciones

⎇ 72a1d81325e63c351a9bcbf07427e676cbe938c4 benches/generated/absolute_layout_in_wrap_reverse_column_container.rs Rust · 33 líneas · 1.2 KB Historia Quién tocó qué crudo

rename stretch to stretch2 79aa44fa4 · elbaro ·

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