fix(extend): use preselected objects as boundary edges

TRIM already takes objects selected before the command as cutting
edges; EXTEND ignored them and extended to the nearest object in the
path. It now takes them as boundary edges the same way.

Fixes #1732

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-13 08:04:13 +03:00
1 parent 925c91ccfa
commit 3840630ab4
2 files changed
+22 -6

No files matched your search

+10 -1
View File
@@ -1386,8 +1386,17 @@ impl OpenCADStudio {
.map(|e| (h, e))
})
.collect();
let initial_edges: Vec<codec::Handle> = self.tabs[i]
.scene
.selected_entities()
.into_iter()
.filter_map(|(handle, entity)| {
crate::modules::draw::modify::trim::is_trim_boundary_entity(&entity)
.then_some(handle)
})
.collect();
let all_entities: Vec<_> = entities.into_iter().map(|(_, e)| e).collect();
let new_cmd = ExtendCommand::new(all_entities);
let new_cmd = ExtendCommand::with_boundary_edges(all_entities, initial_edges);
self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd));
}