⎇ d8c8bb472833ba92d694a9420e4c5bd8308e32e3
benches/generated/min_width.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 {
8 flex_grow: 1f32,
9 min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(60f32), ..Size::auto() },
10 ..Default::default()
11 },
12 &[],
13 )
14 .unwrap();
15 let node1 = taffy.new_with_children(taffy::style::Style { flex_grow: 1f32, ..Default::default() }, &[]).unwrap();
16 let node = taffy
17 .new_with_children(
18 taffy::style::Style {
19 size: taffy::geometry::Size {
20 width: taffy::style::Dimension::Points(100f32),
21 height: taffy::style::Dimension::Points(100f32),
22 ..Size::auto()
23 },
24 ..Default::default()
25 },
26 &[node0, node1],
27 )
28 .unwrap();
29 taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
30}