gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 496HTML 245JavaScript 8CSS 61214 Definiciones

⎇ ac3349ce0fd60591d6019a4658dfe84912514e62 tests/generated/absolute_layout_in_wrap_reverse_row_container.rs Rust · 35 líneas · 1.3 KB Historia Quién tocó qué crudo

[gentest] Split generated tests into separate files. ac3349ce0 · Adam Perry ·

1#[test]
2fn absolute_layout_in_wrap_reverse_row_container() {
3    let layout = stretch::compute(
4        &stretch::style::Node {
5            flex_wrap: stretch::style::FlexWrap::WrapReverse,
6            size: stretch::geometry::Size {
7                width: stretch::style::Dimension::Points(100.0000),
8                height: stretch::style::Dimension::Points(100.0000),
9                ..Default::default()
10            },
11            children: vec![stretch::style::Node {
12                position_type: stretch::style::PositionType::Absolute,
13                size: stretch::geometry::Size {
14                    width: stretch::style::Dimension::Points(20.0000),
15                    height: stretch::style::Dimension::Points(20.0000),
16                    ..Default::default()
17                },
18                ..Default::default()
19            }],
20            ..Default::default()
21        },
22        stretch::geometry::Size::undefined(),
23    )
24    .unwrap();
25
26    assert_eq!(layout.size.width, 100.0000);
27    assert_eq!(layout.size.height, 100.0000);
28    assert_eq!(layout.location.x, 0.0000);
29    assert_eq!(layout.location.y, 0.0000);
30
31    assert_eq!(layout.children[0].size.width, 20.0000);
32    assert_eq!(layout.children[0].size.height, 20.0000);
33    assert_eq!(layout.children[0].location.x, 0.0000);
34    assert_eq!(layout.children[0].location.y, 80.0000);
35}