⎇ d8c8bb472833ba92d694a9420e4c5bd8308e32e3
benches/generated/absolute_layout_start_top_end_bottom.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 position_type: taffy::style::PositionType::Absolute,
9 position: taffy::geometry::Rect {
10 left: taffy::style::LengthPercentageAuto::Points(10f32),
11 right: taffy::style::LengthPercentageAuto::Points(10f32),
12 top: taffy::style::LengthPercentageAuto::Points(10f32),
13 bottom: taffy::style::LengthPercentageAuto::Points(10f32),
14 ..Rect::auto()
15 },
16 ..Default::default()
17 },
18 &[],
19 )
20 .unwrap();
21 let node = taffy
22 .new_with_children(
23 taffy::style::Style {
24 size: taffy::geometry::Size {
25 width: taffy::style::Dimension::Points(100f32),
26 height: taffy::style::Dimension::Points(100f32),
27 ..Size::auto()
28 },
29 ..Default::default()
30 },
31 &[node0],
32 )
33 .unwrap();
34 taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
35}