From 2f33ddbf1a96fb857b33a18d76920e884e4a880b Mon Sep 17 00:00:00 2001 From: ramox81 <184937705+ramox81@users.noreply.github.com> Date: Fri, 11 Sep 2026 12:18:05 +0300 Subject: [PATCH] Allocate fresh handles for split command replacements --- src/app/command_driver.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/command_driver.rs b/src/app/command_driver.rs index 09682d5ab..95e37db31 100644 --- a/src/app/command_driver.rs +++ b/src/app/command_driver.rs @@ -944,8 +944,13 @@ impl OpenCADStudio { // refreshes dependent render caches without erase notifications. if self.tabs[tab].scene.update_entity(entity) { vec![handle] } else { Vec::new() } } else { + let owner = self.tabs[tab].scene.document.get_entity(handle).map(|entity| entity.common().owner_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 { if matches!(self.tabs[tab].scene.document.get_entity(updated), Some(acadrust::EntityType::Dimension(_))) {