From 741b18b55898efe2def3fef0a7e7d9a913907345 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 11:25:23 -0800 Subject: [PATCH] 3D: OK ends the running preview before checking the values again #9835 made OK start a fresh preview to validate the values afresh, but it replaced the running LivePreview without ending it. A fresh preview does not start while another interaction is open, so with Preview on OK was refused and the old preview's interaction stayed open. Reopening the effect then could not preview: main's gate failed on dialogs::revolve::tests::lighting_presets_cancel_restores_an_existing_custom_light_rig. OK now ends the running preview with cancel_preview first, then runs the fresh preview and commits it as before. --- crates/ui-egui/src/dialogs/three_d.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/dialogs/three_d.rs b/crates/ui-egui/src/dialogs/three_d.rs index 4706074962..460d8327f2 100644 --- a/crates/ui-egui/src/dialogs/three_d.rs +++ b/crates/ui-egui/src/dialogs/three_d.rs @@ -254,8 +254,10 @@ fn ok(app: &mut VectorcraftApp, answer: &ParamResult) -> Result<(), String> { return Err(why); } let (cmd, p, _) = s.request(&answer.fields); - // OK must validate afresh: the live preview also caches refused requests. - s.preview = LivePreview::default(); + // OK must validate afresh: the live preview also caches refused requests. The running preview is ended first; + // a fresh preview refuses to start while another interaction is open, which left OK refused and the old + // preview's interaction open. + s.cancel_preview(app); match s.run_preview(app, cmd, &p) { Some(Ok(())) if finish_unchanged_preview(app) => return Ok(()), Some(Err(why)) => {