⎇ b91874d4e34ecc9054b468a338ffcae6f61a1b4a
benches/generated/flex_shrink_to_zero.rs
Ñawpa willay
Pi imata llamkarqan
ch'uya
1pub fn compute() {
2 #[allow(unused_imports)]
3 use taffy::prelude::*;
4 let mut taffy = taffy::Taffy::new();
5 let node0 = taffy
6 .new_leaf(taffy::style::Style {
7 flex_shrink: 0f32,
8 size: taffy::geometry::Size {
9 width: taffy::style::Dimension::Points(50f32),
10 height: taffy::style::Dimension::Points(50f32),
11 },
12 ..Default::default()
13 })
14 .unwrap();
15 let node1 = taffy
16 .new_leaf(taffy::style::Style {
17 flex_shrink: 1f32,
18 size: taffy::geometry::Size {
19 width: taffy::style::Dimension::Points(50f32),
20 height: taffy::style::Dimension::Points(50f32),
21 },
22 ..Default::default()
23 })
24 .unwrap();
25 let node2 = taffy
26 .new_leaf(taffy::style::Style {
27 flex_shrink: 0f32,
28 size: taffy::geometry::Size {
29 width: taffy::style::Dimension::Points(50f32),
30 height: taffy::style::Dimension::Points(50f32),
31 },
32 ..Default::default()
33 })
34 .unwrap();
35 let node = taffy
36 .new_with_children(
37 taffy::style::Style {
38 size: taffy::geometry::Size { width: taffy::style::Dimension::Points(75f32), height: auto() },
39 ..Default::default()
40 },
41 &[node0, node1, node2],
42 )
43 .unwrap();
44 taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
45}