fix(offset): the offset just created can be hovered and offset again

A running command only knew the entities that existed when it started;
committed results are now handed back to it, and OFFSET adds them to its
pick set.

Fixes #673

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-09-28 19:35:19 +03:00
1 parent 4c1ddec646
commit 97a5bc1d39
3 files changed
+25

No files matched your search

+14
View File
@@ -62,6 +62,7 @@ impl OpenCADStudio {
}
if let Some(handle) = committed {
self.apply_continuous_constraints(i, &[handle]);
self.notify_entities_committed(i, &[handle]);
}
self.tabs[i].dirty = true;
let prompt = self.tabs[i].active_cmd.as_ref().map(|c| c.prompt());
@@ -123,6 +124,7 @@ impl OpenCADStudio {
committed.extend(handle);
}
self.apply_continuous_constraints(i, &committed);
self.notify_entities_committed(i, &committed);
self.tabs[i].dirty = true;
self.tabs[i].scene.clear_preview_wire();
let prompt = self.tabs[i].active_cmd.as_ref().map(|c| c.prompt());
@@ -135,6 +137,18 @@ impl OpenCADStudio {
None
}
/// Hand the stored copies of freshly committed entities to the command
/// that is still running.
fn notify_entities_committed(&mut self, i: usize, handles: &[codec::Handle]) {
let entities: Vec<codec::EntityType> = handles
.iter()
.filter_map(|handle| self.tabs[i].scene.document.get_entity(*handle).cloned())
.collect();
if let Some(command) = self.tabs[i].active_cmd.as_mut() {
command.on_entities_committed(&entities);
}
}
pub(super) fn handle_commit_entities_and_exit(
&mut self,
mut entities: Vec<codec::EntityType>,