Skip to content

SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.

3D mouse test: clear the frame's texture changes, so it passes in debug builds (#4382)

Tyler Chiriboga945e6261ccd8
diff --git a/apps/solidcraft/src/space_mouse.rs b/apps/solidcraft/src/space_mouse.rs
index c037f8f6c6..1cf51a677e 100644
--- a/apps/solidcraft/src/space_mouse.rs
+++ b/apps/solidcraft/src/space_mouse.rs
@@ -1051,7 +1051,8 @@ mod tests {
};
// A window that has run a frame with focus, as the app's always has by now.
let ctx = Context::default();
- let _ = ctx.run_ui(egui::RawInput::default(), |_| {});
+ // Clear the frame's texture changes, or dropping them panics in debug builds (as in #60).
+ ctx.run_ui(egui::RawInput::default(), |_| {}).textures_delta.clear();
mouse.tick_at(&mut app, &ctx, now);
let DeviceMotion { motion, seconds } = app.viewport.device_motion.expect("the frame hands the page its motion");
assert_eq!(motion, Motion { translation: [0.0; 3], rotation: [0.0, 0.0, -1.0] });