⎇ 859cc921b3adb8e3b184e6fc0cf0c40b6c5a625b
benches/generated/grid_absolute_row_end.rs
History
Who touched what
raw
Grid/refactor coordinate handling (#301)
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 grid_row: taffy::geometry::Line { start: taffy::style::GridPlacement::Auto, end: line(1i16) },
9 inset: taffy::geometry::Rect {
10 left: taffy::style::LengthPercentageAuto::Points(4f32),
11 right: taffy::style::LengthPercentageAuto::Points(3f32),
12 top: taffy::style::LengthPercentageAuto::Points(1f32),
13 bottom: taffy::style::LengthPercentageAuto::Points(2f32),
14 },
15 ..Default::default()
16 })
17 .unwrap();
18 let node = taffy
19 .new_with_children(
20 taffy::style::Style {
21 display: taffy::style::Display::Grid,
22 grid_template_rows: vec![points(40f32), points(40f32), points(40f32)],
23 grid_template_columns: vec![points(40f32), points(40f32), points(40f32)],
24 padding: taffy::geometry::Rect {
25 left: taffy::style::LengthPercentage::Points(40f32),
26 right: taffy::style::LengthPercentage::Points(20f32),
27 top: taffy::style::LengthPercentage::Points(10f32),
28 bottom: taffy::style::LengthPercentage::Points(30f32),
29 },
30 ..Default::default()
31 },
32 &[node0],
33 )
34 .unwrap();
35 taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
36}