⎇ 0.2.x
benches/generated/flex_grow_within_constrained_min_column.rs
Ñawpa willay
Pi imata llamkarqan
ch'uya
Rename FlexboxLayout back to Style (#251)
1pub fn compute() {
2 let mut taffy = taffy::Taffy::new();
3 let node0 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap();
4 let node1 = taffy
5 .new_with_children(
6 taffy::style::Style {
7 size: taffy::geometry::Size { height: taffy::style::Dimension::Points(50f32), ..Default::default() },
8 ..Default::default()
9 },
10 &[],
11 )
12 .unwrap();
13 let node = taffy
14 .new_with_children(
15 taffy::style::Style {
16 flex_direction: taffy::style::FlexDirection::Column,
17 min_size: taffy::geometry::Size {
18 height: taffy::style::Dimension::Points(100f32),
19 ..Default::default()
20 },
21 ..Default::default()
22 },
23 &[node0, node1],
24 )
25 .unwrap();
26 taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
27}