gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 498HTML 254C 19JavaScript 81349 Definitions

⎇ bd6e1961c57e46cffc98b74abcc126b3264aa0dd benches/generated/margin_left.rs Rust · 25 lines · 921 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![&stretch::node::Node::new(
12            stretch::style::Style {
13                size: stretch::geometry::Size { width: stretch::style::Dimension::Points(10f32), ..Default::default() },
14                margin: stretch::geometry::Rect {
15                    start: stretch::style::Dimension::Points(10f32),
16                    ..Default::default()
17                },
18                ..Default::default()
19            },
20            vec![],
21        )],
22    )
23    .compute_layout(stretch::geometry::Size::undefined())
24    .unwrap()
25}