⎇ ec371711989b7f4d870d91bea4b66bdd94b45c9e
benches/generated/grid_absolute_container_left_overrides_right.rs
Ñawpa willay
Pi imata llamkarqan
ch'uya
Rename PositionType and Position in accordance to specs (#295)
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 size: taffy::geometry::Size { width: taffy::style::Dimension::Points(10f32), height: auto() },
9 inset: taffy::geometry::Rect {
10 left: taffy::style::LengthPercentageAuto::Points(5f32),
11 right: taffy::style::LengthPercentageAuto::Points(2f32),
12 top: auto(),
13 bottom: auto(),
14 },
15 ..Default::default()
16 })
17 .unwrap();
18 let node1 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
19 let node2 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
20 let node3 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
21 let node4 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
22 let node5 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
23 let node6 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
24 let node7 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
25 let node8 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
26 let node = taffy
27 .new_with_children(
28 taffy::style::Style {
29 display: taffy::style::Display::Grid,
30 grid_template_rows: vec![points(40f32), points(40f32), points(40f32)],
31 grid_template_columns: vec![points(40f32), points(40f32), points(40f32)],
32 padding: taffy::geometry::Rect {
33 left: taffy::style::LengthPercentage::Points(40f32),
34 right: taffy::style::LengthPercentage::Points(20f32),
35 top: taffy::style::LengthPercentage::Points(10f32),
36 bottom: taffy::style::LengthPercentage::Points(30f32),
37 },
38 ..Default::default()
39 },
40 &[node0, node1, node2, node3, node4, node5, node6, node7, node8],
41 )
42 .unwrap();
43 taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
44}