gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

HTML 231Rust 10TOML 3CSS 1350 Definiciones

⎇ b541e43e291182626270e360d2b99ca18babb54c benches/generated/flex_grow_within_max_width.rs Rust · 35 líneas · 1.2 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            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            ..Default::default()
11        },
12        vec![&stretch::node::Node::new(
13            stretch::style::Style {
14                max_size: stretch::geometry::Size {
15                    width: stretch::style::Dimension::Points(100f32),
16                    ..Default::default()
17                },
18                ..Default::default()
19            },
20            vec![&stretch::node::Node::new(
21                stretch::style::Style {
22                    flex_grow: 1f32,
23                    size: stretch::geometry::Size {
24                        height: stretch::style::Dimension::Points(20f32),
25                        ..Default::default()
26                    },
27                    ..Default::default()
28                },
29                vec![],
30            )],
31        )],
32    )
33    .compute_layout(stretch::geometry::Size::undefined())
34    .unwrap()
35}