⎇ 9e53f03adea2b770d68954e404d2fa407dfc7d40
benches/generated/gap_column_gap_wrap_align_stretch.rs
Historia
Quién tocó qué
crudo
Implement "gap" property for flexbox algorithm (#248)
1pub fn compute() {
2 let mut taffy = taffy::Taffy::new();
3 let node0 = taffy
4 .new_with_children(
5 taffy::style::FlexboxLayout {
6 flex_grow: 1f32,
7 min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() },
8 ..Default::default()
9 },
10 &[],
11 )
12 .unwrap();
13 let node1 = taffy
14 .new_with_children(
15 taffy::style::FlexboxLayout {
16 flex_grow: 1f32,
17 min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() },
18 ..Default::default()
19 },
20 &[],
21 )
22 .unwrap();
23 let node2 = taffy
24 .new_with_children(
25 taffy::style::FlexboxLayout {
26 flex_grow: 1f32,
27 min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() },
28 ..Default::default()
29 },
30 &[],
31 )
32 .unwrap();
33 let node3 = taffy
34 .new_with_children(
35 taffy::style::FlexboxLayout {
36 flex_grow: 1f32,
37 min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() },
38 ..Default::default()
39 },
40 &[],
41 )
42 .unwrap();
43 let node4 = taffy
44 .new_with_children(
45 taffy::style::FlexboxLayout {
46 flex_grow: 1f32,
47 min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Default::default() },
48 ..Default::default()
49 },
50 &[],
51 )
52 .unwrap();
53 let node = taffy
54 .new_with_children(
55 taffy::style::FlexboxLayout {
56 flex_wrap: taffy::style::FlexWrap::Wrap,
57 gap: taffy::geometry::Size { width: taffy::style::Dimension::Points(5f32), ..Default::default() },
58 size: taffy::geometry::Size {
59 width: taffy::style::Dimension::Points(300f32),
60 height: taffy::style::Dimension::Points(300f32),
61 ..Default::default()
62 },
63 ..Default::default()
64 },
65 &[node0, node1, node2, node3, node4],
66 )
67 .unwrap();
68 taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
69}