gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 499HTML 254C 19JavaScript 81371 Definiciones

⎇ b91874d4e34ecc9054b468a338ffcae6f61a1b4a benches/generated/align_content_not_stretch_with_align_items_stretch.rs Rust · 50 líneas · 1.7 KB Historia Quién tocó qué crudo

Import yoga tests (#320) e05b9093d · Nico Burns ·

1pub fn compute() {
2    #[allow(unused_imports)]
3    use taffy::prelude::*;
4    let mut taffy = taffy::Taffy::new();
5    let node00 = taffy
6        .new_leaf(taffy::style::Style {
7            size: taffy::geometry::Size {
8                width: taffy::style::Dimension::Points(272f32),
9                height: taffy::style::Dimension::Points(44f32),
10            },
11            ..Default::default()
12        })
13        .unwrap();
14    let node0 = taffy
15        .new_with_children(
16            taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, ..Default::default() },
17            &[node00],
18        )
19        .unwrap();
20    let node10 = taffy
21        .new_leaf(taffy::style::Style {
22            size: taffy::geometry::Size {
23                width: taffy::style::Dimension::Points(56f32),
24                height: taffy::style::Dimension::Points(44f32),
25            },
26            ..Default::default()
27        })
28        .unwrap();
29    let node1 = taffy
30        .new_with_children(
31            taffy::style::Style { flex_direction: taffy::style::FlexDirection::Column, ..Default::default() },
32            &[node10],
33        )
34        .unwrap();
35    let node = taffy
36        .new_with_children(
37            taffy::style::Style {
38                flex_wrap: taffy::style::FlexWrap::Wrap,
39                align_content: Some(taffy::style::AlignContent::Start),
40                size: taffy::geometry::Size {
41                    width: taffy::style::Dimension::Points(328f32),
42                    height: taffy::style::Dimension::Points(52f32),
43                },
44                ..Default::default()
45            },
46            &[node0, node1],
47        )
48        .unwrap();
49    taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
50}