tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 501HTML 254C 19JavaScript 81414 Sutichaykuna

⎇ 0.2.x benches/generated/max_width_overrides_width.rs Rust · 18 siq'ikuna · 722 B Ñawpa willay Pi imata llamkarqan ch'uya

Rename FlexboxLayout back to Style (#251) 49893a7d9 · Nico Burns ·

1pub fn compute() {
2    let mut taffy = taffy::Taffy::new();
3    let node0 = taffy
4        .new_with_children(
5            taffy::style::Style {
6                size: taffy::geometry::Size { width: taffy::style::Dimension::Points(200f32), ..Default::default() },
7                max_size: taffy::geometry::Size {
8                    width: taffy::style::Dimension::Points(100f32),
9                    ..Default::default()
10                },
11                ..Default::default()
12            },
13            &[],
14        )
15        .unwrap();
16    let node = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[node0]).unwrap();
17    taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
18}