gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 252HTML 238TOML 3CSS 1626 Definitions

⎇ 3de41935b1054f945bfaeb40dfc213cd57366b9b benches/generated/justify_content_row_space_around.rs Rust · 47 lines · 1.6 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            justify_content: stretch::style::JustifyContent::SpaceAround,
5            size: stretch::geometry::Size {
6                width: stretch::style::Dimension::Points(100f32),
7                height: stretch::style::Dimension::Points(100f32),
8                ..Default::default()
9            },
10            ..Default::default()
11        },
12        vec![
13            &stretch::node::Node::new(
14                stretch::style::Style {
15                    size: stretch::geometry::Size {
16                        width: stretch::style::Dimension::Points(10f32),
17                        ..Default::default()
18                    },
19                    ..Default::default()
20                },
21                vec![],
22            ),
23            &stretch::node::Node::new(
24                stretch::style::Style {
25                    size: stretch::geometry::Size {
26                        width: stretch::style::Dimension::Points(10f32),
27                        ..Default::default()
28                    },
29                    ..Default::default()
30                },
31                vec![],
32            ),
33            &stretch::node::Node::new(
34                stretch::style::Style {
35                    size: stretch::geometry::Size {
36                        width: stretch::style::Dimension::Points(10f32),
37                        ..Default::default()
38                    },
39                    ..Default::default()
40                },
41                vec![],
42            ),
43        ],
44    )
45    .compute_layout(stretch::geometry::Size::undefined())
46    .unwrap()
47}