⎇ b91874d4e34ecc9054b468a338ffcae6f61a1b4a
benches/generated/absolute_layout_width_height_start_top_end_bottom.rs
History
Who touched what
raw
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 {
9 width: taffy::style::Dimension::Points(10f32),
10 height: taffy::style::Dimension::Points(10f32),
11 },
12 inset: taffy::geometry::Rect {
13 left: taffy::style::LengthPercentageAuto::Points(10f32),
14 right: taffy::style::LengthPercentageAuto::Points(10f32),
15 top: taffy::style::LengthPercentageAuto::Points(10f32),
16 bottom: taffy::style::LengthPercentageAuto::Points(10f32),
17 },
18 ..Default::default()
19 })
20 .unwrap();
21 let node = taffy
22 .new_with_children(
23 taffy::style::Style {
24 size: taffy::geometry::Size {
25 width: taffy::style::Dimension::Points(100f32),
26 height: taffy::style::Dimension::Points(100f32),
27 },
28 ..Default::default()
29 },
30 &[node0],
31 )
32 .unwrap();
33 taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
34}