gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 707HTML 660Markdown 12TOML 62344 Sutichaykuna

⎇ 3de41935b1054f945bfaeb40dfc213cd57366b9b benches/generated/flex_basis_smaller_than_content_row.rs Rust · 28 siq'ikuna · 1.1 KB Ñawpa willay Pi imata llamkarqan ch'uya

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 { width: stretch::style::Dimension::Points(100f32), ..Default::default() },
5            ..Default::default()
6        },
7        vec![&stretch::node::Node::new(
8            stretch::style::Style {
9                flex_direction: stretch::style::FlexDirection::Column,
10                flex_basis: stretch::style::Dimension::Points(50f32),
11                ..Default::default()
12            },
13            vec![&stretch::node::Node::new(
14                stretch::style::Style {
15                    size: stretch::geometry::Size {
16                        width: stretch::style::Dimension::Points(100f32),
17                        height: stretch::style::Dimension::Points(100f32),
18                        ..Default::default()
19                    },
20                    ..Default::default()
21                },
22                vec![],
23            )],
24        )],
25    )
26    .compute_layout(stretch::geometry::Size::undefined())
27    .unwrap()
28}