gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

HTML 231Rust 9TOML 3CSS 1347 Definitions

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