MCPcopy Create free account
hub / github.com/OxideEngine/Oxide / zero_width_and_height

Function zero_width_and_height

oxide_math/test/rect.rs:128–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

126 #[test]
127 #[should_panic]
128 fn zero_width_and_height() {
129 let mut world = World::default();
130 let rect_entity: Entity = world.push((Rect {
131 width: 1.0f32,
132 height: 1.0f32,
133 },));
134 set_rect_size(&mut world, &rect_entity, 0.0f32, 0.0f32);
135
136 if let Some(entry) = world.entry(rect_entity) {
137 let rect: Rect = *entry.get_component::<Rect>().unwrap();
138 assert_approx_eq!(rect.width, 0.0f32);
139 assert_approx_eq!(rect.height, 0.0f32);
140 }
141 }
142}

Callers

nothing calls this directly

Calls 1

set_rect_sizeFunction · 0.85

Tested by

no test coverage detected