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

Function test_align

src/align.rs:102–122  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

100
101 #[test]
102 fn test_align() {
103 let parent = rect([0.0, 0.0], [10.0, 10.0]);
104
105 let off = align(
106 rect([0.0, 0.0], [1.0, 1.0]),
107 parent,
108 HAlignment::Center,
109 VAlignment::Middle,
110 );
111 assert_eq!(off.x, 4.5);
112 assert_eq!(off.y, 4.5);
113
114 let off = align(
115 rect([0.0, 0.0], [1.0, 1.0]),
116 parent,
117 HAlignment::Leading,
118 VAlignment::Bottom,
119 );
120 assert_eq!(off.x, 0.0);
121 assert_eq!(off.y, 0.0);
122 }
123}

Callers

nothing calls this directly

Calls 2

rectFunction · 0.85
alignFunction · 0.85

Tested by

no test coverage detected