⎇ b91874d4e34ecc9054b468a338ffcae6f61a1b4a
benches/generated/absolute_aspect_ratio_fill_width_from_inset.rs
Historia
Quién tocó qué
crudo
Fixes for aspect ratio and min/max sizes (#317)
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 position: taffy::style::Position::Absolute,
8 aspect_ratio: Some(3f32),
9 inset: taffy::geometry::Rect {
10 left: auto(),
11 right: auto(),
12 top: taffy::style::LengthPercentageAuto::Percent(0.3f32),
13 bottom: taffy::style::LengthPercentageAuto::Percent(0.5f32),
14 },
15 ..Default::default()
16 })
17 .unwrap();
18 let node = taffy
19 .new_with_children(
20 taffy::style::Style {
21 display: taffy::style::Display::Flex,
22 size: taffy::geometry::Size {
23 width: taffy::style::Dimension::Points(400f32),
24 height: taffy::style::Dimension::Points(300f32),
25 },
26 ..Default::default()
27 },
28 &[node0],
29 )
30 .unwrap();
31 taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
32}