gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

HTML 5544Rust 88Markdown 11TOML 91926 Definitions

⎇ 3de41935b1054f945bfaeb40dfc213cd57366b9b benches/generated/justify_content_column_space_around.rs Rust · 48 lines · 1.7 KB History Who touched what raw

update tests and benchmarks to use new api 1f8c44154 · Emil Sjölander ·

1pub fn compute() -> stretch::result::Layout {
2    stretch::node::Node::new(
3        stretch::style::Style {
4            flex_direction: stretch::style::FlexDirection::Column,
5            justify_content: stretch::style::JustifyContent::SpaceAround,
6            size: stretch::geometry::Size {
7                width: stretch::style::Dimension::Points(100f32),
8                height: stretch::style::Dimension::Points(100f32),
9                ..Default::default()
10            },
11            ..Default::default()
12        },
13        vec![
14            &stretch::node::Node::new(
15                stretch::style::Style {
16                    size: stretch::geometry::Size {
17                        height: stretch::style::Dimension::Points(10f32),
18                        ..Default::default()
19                    },
20                    ..Default::default()
21                },
22                vec![],
23            ),
24            &stretch::node::Node::new(
25                stretch::style::Style {
26                    size: stretch::geometry::Size {
27                        height: stretch::style::Dimension::Points(10f32),
28                        ..Default::default()
29                    },
30                    ..Default::default()
31                },
32                vec![],
33            ),
34            &stretch::node::Node::new(
35                stretch::style::Style {
36                    size: stretch::geometry::Size {
37                        height: stretch::style::Dimension::Points(10f32),
38                        ..Default::default()
39                    },
40                    ..Default::default()
41                },
42                vec![],
43            ),
44        ],
45    )
46    .compute_layout(stretch::geometry::Size::undefined())
47    .unwrap()
48}