gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 501HTML 254C 19JavaScript 81414 Definiciones

⎇ 3de41935b1054f945bfaeb40dfc213cd57366b9b benches/generated/margin_top.rs Rust · 26 líneas · 987 B 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(100f32),
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                size: stretch::geometry::Size {
15                    height: stretch::style::Dimension::Points(10f32),
16                    ..Default::default()
17                },
18                margin: stretch::geometry::Rect { top: stretch::style::Dimension::Points(10f32), ..Default::default() },
19                ..Default::default()
20            },
21            vec![],
22        )],
23    )
24    .compute_layout(stretch::geometry::Size::undefined())
25    .unwrap()
26}