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