forked from 1b-agent/opencadstudio-upstream
fix(view): -VIEW settings open no undo step for a view that is gone
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e5df2fd113
commit
a542a401d9
1 file changed
+3
-3
@@ -270,11 +270,11 @@ impl OpenCADStudio {
|
|||||||
|
|
||||||
/// One setting of -VIEW's sEttings option on the named view.
|
/// One setting of -VIEW's sEttings option on the named view.
|
||||||
fn apply_view_setting(&mut self, i: usize, setting: &str, name: &str, value: &str) {
|
fn apply_view_setting(&mut self, i: usize, setting: &str, name: &str, value: &str) {
|
||||||
self.push_undo_snapshot(i, "-VIEW");
|
let Some(mut view) = self.tabs[i].scene.document.views.get(name).cloned() else {
|
||||||
let document = &mut self.tabs[i].scene.document;
|
|
||||||
let Some(mut view) = document.views.get(name).cloned() else {
|
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
self.push_undo_snapshot(i, "-VIEW");
|
||||||
|
let document = &mut self.tabs[i].scene.document;
|
||||||
if view.handle.is_null() {
|
if view.handle.is_null() {
|
||||||
view.handle = document.allocate_handle();
|
view.handle = document.allocate_handle();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user