| 145 | |
| 146 | #[test] |
| 147 | fn test_padding_auto() { |
| 148 | let mut cx = Context::new(); |
| 149 | let ui = Padding::new(rectangle(), PaddingParam::Auto); |
| 150 | let sz = [50.0, 50.0].into(); |
| 151 | let mut path = vec![0]; |
| 152 | let result = ui.layout( |
| 153 | &mut path, |
| 154 | &mut LayoutArgs { |
| 155 | sz, |
| 156 | cx: &mut cx, |
| 157 | text_bounds: &mut |_, _, _| LocalRect::zero(), |
| 158 | }, |
| 159 | ); |
| 160 | // Auto padding is 5.0, so child gets 40x40, result is 50x50 |
| 161 | assert_eq!(result, [50.0, 50.0].into()); |
| 162 | } |
| 163 | |
| 164 | #[test] |
| 165 | fn test_padding_hittest_offsets() { |