⎇ bf3dfaec9e387a7e67408fc78ca869d7eaaa8e1f
benches/generated/min_max_percent_no_width_height.rs
Historia
Quién tocó qué
crudo
Reinstate FlexStart and FlexEnd alignment variants (#336)
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 min_size: taffy::geometry::Size {
8 width: taffy::style::Dimension::Percent(0.1f32),
9 height: taffy::style::Dimension::Percent(0.1f32),
10 },
11 max_size: taffy::geometry::Size {
12 width: taffy::style::Dimension::Percent(0.1f32),
13 height: taffy::style::Dimension::Percent(0.1f32),
14 },
15 ..Default::default()
16 })
17 .unwrap();
18 let node = taffy
19 .new_with_children(
20 taffy::style::Style {
21 flex_direction: taffy::style::FlexDirection::Column,
22 align_items: Some(taffy::style::AlignItems::FlexStart),
23 size: taffy::geometry::Size {
24 width: taffy::style::Dimension::Points(100f32),
25 height: taffy::style::Dimension::Points(100f32),
26 },
27 ..Default::default()
28 },
29 &[node0],
30 )
31 .unwrap();
32 taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
33}