fix(trim): handle lasso and box selection

Keep selection gestures in the active trim flow so crossed segments are modified instead of selected.\n\nRefs #487
This commit is contained in:
Hakan Seven committed 2026-08-05 00:26:29 +03:00
1 parent 474bfcc7db
commit b92b8df997
4 files changed
+263 -21

No files matched your search

+25
View File
@@ -1169,6 +1169,31 @@ impl OpenCADStudio {
}
self.refresh_properties();
}
CmdResult::ReplaceManyContinue(replacements) => {
let label = self.history_label_from_active_cmd(i, "TRIM");
self.push_undo_snapshot(i, label);
for (handle, entities) in replacements {
self.tabs[i].scene.erase_entities(&[handle]);
let new_handles: Vec<Handle> = entities
.into_iter()
.map(|entity| self.tabs[i].scene.add_entity(entity))
.collect();
if let Some(command) = self.tabs[i].active_cmd.as_mut() {
command.on_entity_replaced(handle, &new_handles);
}
}
self.tabs[i].dirty = true;
self.tabs[i].scene.clear_preview_wire();
self.tabs[i].snap_result = None;
if let Some(prompt) = self.tabs[i]
.active_cmd
.as_ref()
.map(|command| command.prompt())
{
self.command_line.push_info(&prompt);
}
self.refresh_properties();
}
CmdResult::ReplaceEntity(handle, new_entities) => {
// Detect SPLINEDIT sentinel: a single XLine with a magic layer name.
if new_entities.len() == 1 {