⎇ 9e53f03adea2b770d68954e404d2fa407dfc7d40
benches/generated/flex_grow_within_max_width.rs
History
Who touched what
raw
Layout algorithm decoupling, Sizing Constraints & Perf Improvements (#246)
1pub fn compute() {
2 let mut taffy = taffy::Taffy::new();
3 let node00 = taffy
4 .new_with_children(
5 taffy::style::FlexboxLayout {
6 flex_grow: 1f32,
7 size: taffy::geometry::Size { height: taffy::style::Dimension::Points(20f32), ..Default::default() },
8 ..Default::default()
9 },
10 &[],
11 )
12 .unwrap();
13 let node0 = taffy
14 .new_with_children(
15 taffy::style::FlexboxLayout {
16 max_size: taffy::geometry::Size {
17 width: taffy::style::Dimension::Points(100f32),
18 ..Default::default()
19 },
20 ..Default::default()
21 },
22 &[node00],
23 )
24 .unwrap();
25 let node = taffy
26 .new_with_children(
27 taffy::style::FlexboxLayout {
28 flex_direction: taffy::style::FlexDirection::Column,
29 size: taffy::geometry::Size {
30 width: taffy::style::Dimension::Points(200f32),
31 height: taffy::style::Dimension::Points(100f32),
32 ..Default::default()
33 },
34 ..Default::default()
35 },
36 &[node0],
37 )
38 .unwrap();
39 taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
40}