⎇ 0.2.x
benches/generated/justify_content_overflow_min_max.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
4 .new_with_children(
5 taffy::style::Style {
6 flex_shrink: 0f32,
7 size: taffy::geometry::Size {
8 width: taffy::style::Dimension::Points(50f32),
9 height: taffy::style::Dimension::Points(50f32),
10 ..Default::default()
11 },
12 ..Default::default()
13 },
14 &[],
15 )
16 .unwrap();
17 let node1 = taffy
18 .new_with_children(
19 taffy::style::Style {
20 flex_shrink: 0f32,
21 size: taffy::geometry::Size {
22 width: taffy::style::Dimension::Points(50f32),
23 height: taffy::style::Dimension::Points(50f32),
24 ..Default::default()
25 },
26 ..Default::default()
27 },
28 &[],
29 )
30 .unwrap();
31 let node2 = taffy
32 .new_with_children(
33 taffy::style::Style {
34 flex_shrink: 0f32,
35 size: taffy::geometry::Size {
36 width: taffy::style::Dimension::Points(50f32),
37 height: taffy::style::Dimension::Points(50f32),
38 ..Default::default()
39 },
40 ..Default::default()
41 },
42 &[],
43 )
44 .unwrap();
45 let node = taffy
46 .new_with_children(
47 taffy::style::Style {
48 flex_direction: taffy::style::FlexDirection::Column,
49 justify_content: taffy::style::JustifyContent::Center,
50 min_size: taffy::geometry::Size {
51 height: taffy::style::Dimension::Points(100f32),
52 ..Default::default()
53 },
54 max_size: taffy::geometry::Size {
55 height: taffy::style::Dimension::Points(110f32),
56 ..Default::default()
57 },
58 ..Default::default()
59 },
60 &[node0, node1, node2],
61 )
62 .unwrap();
63 taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
64}