forked from 1b-agent/opencadstudio-upstream
Allocate fresh handles for split command replacements
This commit is contained in:
1 parent
55454cbe6b
commit
2f33ddbf1a
1 file changed
+6
-1
@@ -944,8 +944,13 @@ impl OpenCADStudio {
|
|||||||
// refreshes dependent render caches without erase notifications.
|
// refreshes dependent render caches without erase notifications.
|
||||||
if self.tabs[tab].scene.update_entity(entity) { vec![handle] } else { Vec::new() }
|
if self.tabs[tab].scene.update_entity(entity) { vec![handle] } else { Vec::new() }
|
||||||
} else {
|
} else {
|
||||||
|
let owner = self.tabs[tab].scene.document.get_entity(handle).map(|entity| entity.common().owner_handle);
|
||||||
self.tabs[tab].scene.erase_entities(&[handle]);
|
self.tabs[tab].scene.erase_entities(&[handle]);
|
||||||
entities.into_iter().map(|entity| self.tabs[tab].scene.add_entity(entity)).collect()
|
entities.into_iter().map(|mut entity| {
|
||||||
|
entity.common_mut().handle = Handle::NULL;
|
||||||
|
if let Some(owner) = owner { entity.common_mut().owner_handle = owner; }
|
||||||
|
self.tabs[tab].scene.add_entity(entity)
|
||||||
|
}).collect()
|
||||||
};
|
};
|
||||||
for &updated in &handles {
|
for &updated in &handles {
|
||||||
if matches!(self.tabs[tab].scene.document.get_entity(updated), Some(acadrust::EntityType::Dimension(_))) {
|
if matches!(self.tabs[tab].scene.document.get_entity(updated), Some(acadrust::EntityType::Dimension(_))) {
|
||||||
|
|||||||
Reference in new issue
Block a user