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.
This commit is contained in:
dotCooCoo committed 2026-11-28 11:25:23 -08:00
1 parent fb450d346d
commit 741b18b558
1 file changed
+4 -2
+4 -2
View File
@@ -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)) => {