⎇ b91874d4e34ecc9054b468a338ffcae6f61a1b4a
benches/generated/margin_auto_right.rs
Historia
Quién tocó qué
crudo
1pub fn compute() {
2 #[allow(unused_imports)]
3 use taffy::prelude::*;
4 let mut taffy = taffy::Taffy::new();
5 let node0 = taffy
6 .new_leaf(taffy::style::Style {
7 size: taffy::geometry::Size {
8 width: taffy::style::Dimension::Points(50f32),
9 height: taffy::style::Dimension::Points(50f32),
10 },
11 margin: taffy::geometry::Rect {
12 left: zero(),
13 right: taffy::style::LengthPercentageAuto::Auto,
14 top: zero(),
15 bottom: zero(),
16 },
17 ..Default::default()
18 })
19 .unwrap();
20 let node1 = taffy
21 .new_leaf(taffy::style::Style {
22 size: taffy::geometry::Size {
23 width: taffy::style::Dimension::Points(50f32),
24 height: taffy::style::Dimension::Points(50f32),
25 },
26 ..Default::default()
27 })
28 .unwrap();
29 let node = taffy
30 .new_with_children(
31 taffy::style::Style {
32 align_items: Some(taffy::style::AlignItems::Center),
33 size: taffy::geometry::Size {
34 width: taffy::style::Dimension::Points(200f32),
35 height: taffy::style::Dimension::Points(200f32),
36 },
37 ..Default::default()
38 },
39 &[node0, node1],
40 )
41 .unwrap();
42 taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
43}