tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 583HTML 275Markdown 8TOML 41586 Definitions

⎇ ec371711989b7f4d870d91bea4b66bdd94b45c9e benches/generated/align_self_flex_start.rs Rust · 28 lines · 958 B History Who touched what raw

Reinstate FlexStart and FlexEnd alignment variants (#336) 78fd9cc09 · Nico Burns ·

1pub fn compute() {
2    #[allow(unused_imports)]
3    use taffy::prelude::*;
4    let mut taffy = taffy::Taffy::new();
5    let node0 = taffy
6        .new_leaf(taffy::style::Style {
7            align_self: Some(taffy::style::AlignSelf::FlexStart),
8            size: taffy::geometry::Size {
9                width: taffy::style::Dimension::Points(10f32),
10                height: taffy::style::Dimension::Points(10f32),
11            },
12            ..Default::default()
13        })
14        .unwrap();
15    let node = taffy
16        .new_with_children(
17            taffy::style::Style {
18                size: taffy::geometry::Size {
19                    width: taffy::style::Dimension::Points(100f32),
20                    height: taffy::style::Dimension::Points(100f32),
21                },
22                ..Default::default()
23            },
24            &[node0],
25        )
26        .unwrap();
27    taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
28}