gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 499HTML 254C 19JavaScript 81378 Definiciones

⎇ 3de41935b1054f945bfaeb40dfc213cd57366b9b benches/generated/absolute_layout_child_order.rs Rust · 52 líneas · 2.0 KB Historia Quién tocó qué crudo

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            align_items: stretch::style::AlignItems::Center,
5            justify_content: stretch::style::JustifyContent::Center,
6            size: stretch::geometry::Size {
7                width: stretch::style::Dimension::Points(110f32),
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                        width: stretch::style::Dimension::Points(60f32),
18                        height: stretch::style::Dimension::Points(40f32),
19                        ..Default::default()
20                    },
21                    ..Default::default()
22                },
23                vec![],
24            ),
25            &stretch::node::Node::new(
26                stretch::style::Style {
27                    position_type: stretch::style::PositionType::Absolute,
28                    size: stretch::geometry::Size {
29                        width: stretch::style::Dimension::Points(60f32),
30                        height: stretch::style::Dimension::Points(40f32),
31                        ..Default::default()
32                    },
33                    ..Default::default()
34                },
35                vec![],
36            ),
37            &stretch::node::Node::new(
38                stretch::style::Style {
39                    size: stretch::geometry::Size {
40                        width: stretch::style::Dimension::Points(60f32),
41                        height: stretch::style::Dimension::Points(40f32),
42                        ..Default::default()
43                    },
44                    ..Default::default()
45                },
46                vec![],
47            ),
48        ],
49    )
50    .compute_layout(stretch::geometry::Size::undefined())
51    .unwrap()
52}