gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

HTML 5364Rust 86Markdown 12TOML 91841 Definiciones

⎇ 0.1.x tests/generated/border_no_child.rs Rust · 24 líneas · 947 B Historia Quién tocó qué crudo

Rename sprawl to taffy (#134) 8936790d6 · Alice Cecile ·

1#[test]
2fn border_no_child() {
3    let mut taffy = taffy::Taffy::new();
4    let node = taffy
5        .new_node(
6            taffy::style::Style {
7                border: taffy::geometry::Rect {
8                    start: taffy::style::Dimension::Points(10f32),
9                    end: taffy::style::Dimension::Points(10f32),
10                    top: taffy::style::Dimension::Points(10f32),
11                    bottom: taffy::style::Dimension::Points(10f32),
12                    ..Default::default()
13                },
14                ..Default::default()
15            },
16            &[],
17        )
18        .unwrap();
19    taffy.compute_layout(node, taffy::geometry::Size::undefined()).unwrap();
20    assert_eq!(taffy.layout(node).unwrap().size.width, 20f32);
21    assert_eq!(taffy.layout(node).unwrap().size.height, 20f32);
22    assert_eq!(taffy.layout(node).unwrap().location.x, 0f32);
23    assert_eq!(taffy.layout(node).unwrap().location.y, 0f32);
24}