tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 501HTML 254C 19JavaScript 81414 Sutichaykuna

⎇ b91874d4e34ecc9054b468a338ffcae6f61a1b4a benches/generated/absolute_layout_in_wrap_reverse_column_container.rs Rust · 30 siq'ikuna · 1.1 KB Ñawpa willay Pi imata llamkarqan ch'uya

Rename PositionType and Position in accordance to specs (#295) e2cee9d6f · Andreas Weibye ·

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            position: taffy::style::Position::Absolute,
8            size: taffy::geometry::Size {
9                width: taffy::style::Dimension::Points(20f32),
10                height: taffy::style::Dimension::Points(20f32),
11            },
12            ..Default::default()
13        })
14        .unwrap();
15    let node = taffy
16        .new_with_children(
17            taffy::style::Style {
18                flex_direction: taffy::style::FlexDirection::Column,
19                flex_wrap: taffy::style::FlexWrap::WrapReverse,
20                size: taffy::geometry::Size {
21                    width: taffy::style::Dimension::Points(100f32),
22                    height: taffy::style::Dimension::Points(100f32),
23                },
24                ..Default::default()
25            },
26            &[node0],
27        )
28        .unwrap();
29    taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
30}