tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 499HTML 238Markdown 7TOML 31234 Definitions

⎇ 8024120f87fc30308be94abc65ab3b55dccfc4c1 benches/generated/flex_grow_within_max_width.rs Rust · 30 lines · 1.1 KB History Who touched what raw

Generate benchmarks for all test fixtures 8024120f8 · Emil Sjölander ·

1pub fn compute() -> stretch::layout::Node {
2    stretch::compute(
3        &stretch::style::Node {
4            flex_direction: stretch::style::FlexDirection::Column,
5            size: stretch::geometry::Size {
6                width: stretch::style::Dimension::Points(200f32),
7                height: stretch::style::Dimension::Points(100f32),
8                ..Default::default()
9            },
10            children: vec![stretch::style::Node {
11                max_size: stretch::geometry::Size {
12                    width: stretch::style::Dimension::Points(100f32),
13                    ..Default::default()
14                },
15                children: vec![stretch::style::Node {
16                    flex_grow: 1f32,
17                    size: stretch::geometry::Size {
18                        height: stretch::style::Dimension::Points(20f32),
19                        ..Default::default()
20                    },
21                    ..Default::default()
22                }],
23                ..Default::default()
24            }],
25            ..Default::default()
26        },
27        stretch::geometry::Size::undefined(),
28    )
29    .unwrap()
30}