⎇ d8c8bb472833ba92d694a9420e4c5bd8308e32e3
benches/generated/flex_direction_column.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 size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() },
9 ..Default::default()
10 },
11 &[],
12 )
13 .unwrap();
14 let node1 = taffy
15 .new_with_children(
16 taffy::style::Style {
17 size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() },
18 ..Default::default()
19 },
20 &[],
21 )
22 .unwrap();
23 let node2 = taffy
24 .new_with_children(
25 taffy::style::Style {
26 size: taffy::geometry::Size { height: taffy::style::Dimension::Points(10f32), ..Size::auto() },
27 ..Default::default()
28 },
29 &[],
30 )
31 .unwrap();
32 let node = taffy
33 .new_with_children(
34 taffy::style::Style {
35 flex_direction: taffy::style::FlexDirection::Column,
36 size: taffy::geometry::Size {
37 width: taffy::style::Dimension::Points(100f32),
38 height: taffy::style::Dimension::Points(100f32),
39 ..Size::auto()
40 },
41 ..Default::default()
42 },
43 &[node0, node1, node2],
44 )
45 .unwrap();
46 taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
47}