⎇ d8c8bb472833ba92d694a9420e4c5bd8308e32e3
benches/generated/flex_basis_flex_shrink_row.rs
Historia
Quién tocó qué
crudo
Strict types for style values (#269)
1pub fn compute() {
2 #[allow(unused_imports)]
3 use taffy::prelude::*;
4 let mut taffy = taffy::Taffy::new();
5 let node0 = taffy
6 .new_with_children(
7 taffy::style::Style { flex_basis: taffy::style::Dimension::Points(100f32), ..Default::default() },
8 &[],
9 )
10 .unwrap();
11 let node1 = taffy
12 .new_with_children(
13 taffy::style::Style { flex_basis: taffy::style::Dimension::Points(50f32), ..Default::default() },
14 &[],
15 )
16 .unwrap();
17 let node = taffy
18 .new_with_children(
19 taffy::style::Style {
20 size: taffy::geometry::Size {
21 width: taffy::style::Dimension::Points(100f32),
22 height: taffy::style::Dimension::Points(100f32),
23 ..Size::auto()
24 },
25 ..Default::default()
26 },
27 &[node0, node1],
28 )
29 .unwrap();
30 taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
31}