Rename Rect field start->left end->right (#257)
1#[test]
2fn padding_align_end_child() {
3 let mut taffy = taffy::Taffy::new();
4 let node0 = taffy
5 .new_with_children(
6 taffy::style::Style {
7 size: taffy::geometry::Size {
8 width: taffy::style::Dimension::Points(100f32),
9 height: taffy::style::Dimension::Points(100f32),
10 ..Default::default()
11 },
12 padding: taffy::geometry::Rect {
13 left: taffy::style::Dimension::Points(20f32),
14 right: taffy::style::Dimension::Points(20f32),
15 top: taffy::style::Dimension::Points(20f32),
16 bottom: taffy::style::Dimension::Points(20f32),
17 ..Default::default()
18 },
19 ..Default::default()
20 },
21 &[],
22 )
23 .unwrap();
24 let node = taffy
25 .new_with_children(
26 taffy::style::Style {
27 align_items: taffy::style::AlignItems::FlexEnd,
28 justify_content: taffy::style::JustifyContent::FlexEnd,
29 size: taffy::geometry::Size {
30 width: taffy::style::Dimension::Points(200f32),
31 height: taffy::style::Dimension::Points(200f32),
32 ..Default::default()
33 },
34 ..Default::default()
35 },
36 &[node0],
37 )
38 .unwrap();
39 taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
40 assert_eq!(taffy.layout(node).unwrap().size.width, 200f32);
41 assert_eq!(taffy.layout(node).unwrap().size.height, 200f32);
42 assert_eq!(taffy.layout(node).unwrap().location.x, 0f32);
43 assert_eq!(taffy.layout(node).unwrap().location.y, 0f32);
44 assert_eq!(taffy.layout(node0).unwrap().size.width, 100f32);
45 assert_eq!(taffy.layout(node0).unwrap().size.height, 100f32);
46 assert_eq!(taffy.layout(node0).unwrap().location.x, 100f32);
47 assert_eq!(taffy.layout(node0).unwrap().location.y, 100f32);
48}