forked from 1b-agent/opencadstudio-upstream
fix(model): preserve solid history lifecycle
This commit is contained in:
1 parent
d2993fd054
commit
4ac10187c2
15 files changed
+292
-63
No files matched your search
@@ -369,6 +369,8 @@ pub(super) fn on_tab_close(&mut self, idx: usize) -> Task<Message> {
|
||||
.collect();
|
||||
}
|
||||
|
||||
self.capture_grip_history_originals(i, &edited_handles);
|
||||
|
||||
self.grip_preview_handles = edited_handles;
|
||||
}
|
||||
let delta = target - grip.last_world;
|
||||
|
||||
@@ -1070,6 +1070,7 @@ impl OpenCADStudio {
|
||||
})
|
||||
.collect();
|
||||
}
|
||||
self.capture_grip_history_originals(i, &edited_handles);
|
||||
for &handle in &edited_handles {
|
||||
if !self.tabs[i].scene.meshes.contains_key(&handle) {
|
||||
self.tabs[i].scene.preview_hidden.insert(handle);
|
||||
@@ -2733,6 +2734,7 @@ impl OpenCADStudio {
|
||||
// edited entity back into the resident tessellation.
|
||||
let handles = std::mem::take(&mut self.grip_preview_handles);
|
||||
let originals = std::mem::take(&mut self.grip_originals);
|
||||
let history_originals = std::mem::take(&mut self.grip_history_originals);
|
||||
let dirty_before = self.grip_dirty_before.take().unwrap_or(self.tabs[i].dirty);
|
||||
if !handles.is_empty() {
|
||||
if !originals.is_empty() {
|
||||
@@ -2743,6 +2745,10 @@ impl OpenCADStudio {
|
||||
.into_iter()
|
||||
.map(|(handle, entity)| (handle, std::sync::Arc::new(entity)))
|
||||
.collect(),
|
||||
history_originals
|
||||
.into_iter()
|
||||
.flat_map(|(_, objects)| objects)
|
||||
.collect(),
|
||||
dirty_before,
|
||||
);
|
||||
self.tabs[i].dirty = true;
|
||||
|
||||
Reference in new issue
Block a user