tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 501HTML 254C 19JavaScript 81414 Definiciones

⎇ a9acf58cd4179aba3230ea7abd27003dc445c034 tests/generated/justify_content_column_min_height_and_margin_top.rs Rust · 33 líneas · 1.4 KB Historia Quién tocó qué crudo

[gentest] Refactor gentest to use WebDriver & quote crate. a9acf58cd · Adam Perry ·

1#[test]
2fn justify_content_column_min_height_and_margin_top() {
3    let layout = stretch::compute(
4        &stretch::style::Node {
5            flex_direction: stretch::style::FlexDirection::Column,
6            justify_content: stretch::style::JustifyContent::Center,
7            min_size: stretch::geometry::Size {
8                height: stretch::style::Dimension::Points(50f32),
9                ..Default::default()
10            },
11            children: vec![stretch::style::Node {
12                size: stretch::geometry::Size {
13                    width: stretch::style::Dimension::Points(20f32),
14                    height: stretch::style::Dimension::Points(20f32),
15                    ..Default::default()
16                },
17                margin: stretch::geometry::Rect { top: stretch::style::Dimension::Points(10f32), ..Default::default() },
18                ..Default::default()
19            }],
20            ..Default::default()
21        },
22        stretch::geometry::Size::undefined(),
23    )
24    .unwrap();
25    assert_eq!(layout.size.width, 20f32);
26    assert_eq!(layout.size.height, 50f32);
27    assert_eq!(layout.location.x, 0f32);
28    assert_eq!(layout.location.y, 0f32);
29    assert_eq!(layout.children[0usize].size.width, 20f32);
30    assert_eq!(layout.children[0usize].size.height, 20f32);
31    assert_eq!(layout.children[0usize].location.x, 0f32);
32    assert_eq!(layout.children[0usize].location.y, 20f32);
33}