gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 708HTML 661Markdown 12TOML 62346 Sutichaykuna

⎇ 0.2.x benches/generated/padding_no_child.rs Rust · 19 siq'ikuna · 695 B Ñawpa willay Pi imata llamkarqan ch'uya

Rename Rect field start->left end->right (#257) ca514f6c8 · Nico Burns ·

1pub fn compute() {
2    let mut taffy = taffy::Taffy::new();
3    let node = taffy
4        .new_with_children(
5            taffy::style::Style {
6                padding: taffy::geometry::Rect {
7                    left: taffy::style::Dimension::Points(10f32),
8                    right: taffy::style::Dimension::Points(10f32),
9                    top: taffy::style::Dimension::Points(10f32),
10                    bottom: taffy::style::Dimension::Points(10f32),
11                    ..Default::default()
12                },
13                ..Default::default()
14            },
15            &[],
16        )
17        .unwrap();
18    taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
19}