gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

HTML 231Rust 9TOML 3CSS 1345 Definitions

⎇ 3de41935b1054f945bfaeb40dfc213cd57366b9b benches/generated/flex_basis_flex_grow_row.rs Rust · 25 lines · 887 B 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            size: stretch::geometry::Size {
5                width: stretch::style::Dimension::Points(100f32),
6                height: stretch::style::Dimension::Points(100f32),
7                ..Default::default()
8            },
9            ..Default::default()
10        },
11        vec![
12            &stretch::node::Node::new(
13                stretch::style::Style {
14                    flex_grow: 1f32,
15                    flex_basis: stretch::style::Dimension::Points(50f32),
16                    ..Default::default()
17                },
18                vec![],
19            ),
20            &stretch::node::Node::new(stretch::style::Style { flex_grow: 1f32, ..Default::default() }, vec![]),
21        ],
22    )
23    .compute_layout(stretch::geometry::Size::undefined())
24    .unwrap()
25}