MCPcopy Create free account
hub / github.com/audulus/rui / test_padding_auto

Function test_padding_auto

src/views/padding.rs:147–162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 2

rectangleFunction · 0.85
layoutMethod · 0.45

Tested by

no test coverage detected