gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 707HTML 660Markdown 12TOML 62344 Definitions

⎇ 3de41935b1054f945bfaeb40dfc213cd57366b9b benches/generated/margin_bottom.rs Rust · 30 lines · 1.1 KB 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            flex_direction: stretch::style::FlexDirection::Column,
5            justify_content: stretch::style::JustifyContent::FlexEnd,
6            size: stretch::geometry::Size {
7                width: stretch::style::Dimension::Points(100f32),
8                height: stretch::style::Dimension::Points(100f32),
9                ..Default::default()
10            },
11            ..Default::default()
12        },
13        vec![&stretch::node::Node::new(
14            stretch::style::Style {
15                size: stretch::geometry::Size {
16                    height: stretch::style::Dimension::Points(10f32),
17                    ..Default::default()
18                },
19                margin: stretch::geometry::Rect {
20                    bottom: stretch::style::Dimension::Points(10f32),
21                    ..Default::default()
22                },
23                ..Default::default()
24            },
25            vec![],
26        )],
27    )
28    .compute_layout(stretch::geometry::Size::undefined())
29    .unwrap()
30}