tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 501HTML 254C 19JavaScript 81414 Definitions

⎇ b0c7d824daea2c453850812d532c277f8ac37736 benches/generated/absolute_layout_row_width_height_end_bottom.rs Rust · 34 lines · 1.2 KB History Who touched what raw

Import yoga tests (#320) e05b9093d · 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            position: taffy::style::Position::Absolute,
8            size: taffy::geometry::Size {
9                width: taffy::style::Dimension::Points(10f32),
10                height: taffy::style::Dimension::Points(10f32),
11            },
12            inset: taffy::geometry::Rect {
13                left: auto(),
14                right: taffy::style::LengthPercentageAuto::Points(10f32),
15                top: auto(),
16                bottom: taffy::style::LengthPercentageAuto::Points(10f32),
17            },
18            ..Default::default()
19        })
20        .unwrap();
21    let node = taffy
22        .new_with_children(
23            taffy::style::Style {
24                size: taffy::geometry::Size {
25                    width: taffy::style::Dimension::Points(100f32),
26                    height: taffy::style::Dimension::Points(100f32),
27                },
28                ..Default::default()
29            },
30            &[node0],
31        )
32        .unwrap();
33    taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
34}