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 <noreply@anthropic.com>
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

+12 -5
View File
@@ -3358,21 +3358,28 @@ pub struct ExtendCommand {
impl ExtendCommand {
pub fn new(all_entities: Vec<EntityType>) -> Self {
Self::with_boundary_edges(all_entities, Vec::new())
}
/// Objects selected before the command are its boundary edges, as TRIM
/// takes them as cutting edges.
pub fn with_boundary_edges(all_entities: Vec<EntityType>, initial_edges: Vec<Handle>) -> Self {
let all_entities: Vec<EntityType> = all_entities
.iter()
.map(entity_with_lwpolyline_world_xy)
.collect();
let entity_index = ModifyEntityIndex::build(&all_entities);
let geos = build_geos(&all_entities);
Self {
let mut cmd = Self {
all_entities,
entity_index,
geos,
geos: Vec::new(),
mode: TrimMode::Pick,
edge_set: Vec::new(),
edge_set: initial_edges,
implied_edges: false,
shift: false,
}
};
cmd.rebuild_geos();
cmd
}
fn rebuild_geos(&mut self) {