fix(trim): assign handle to trimmed polyline so it can be trimmed again (#65)

TrimCommand::on_entity_replaced never matched LwPolyline, so a trimmed
(closed or open) polyline kept a NULL handle in the command's entity
snapshot. A second pick on the same polyline then found nothing, so it
could not be trimmed more than once without restarting the command.
ExtendCommand already handled this case.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-06-14 00:04:38 +03:00
1 parent 57d3e620ea
commit ae86ad7582
1 file changed
+5
+5
View File
@@ -2158,6 +2158,11 @@ impl CadCommand for TrimCommand {
EntityType::XLine(x) => x.common.handle = h,
EntityType::Ellipse(e) => e.common.handle = h,
EntityType::Spline(s) => s.common.handle = h,
// A trimmed (closed or open) polyline is re-emitted as an
// LwPolyline; without its real handle it can't be found on a
// second pick, so the same polyline couldn't be trimmed twice
// in one TRIM command.
EntityType::LwPolyline(p) => p.common.handle = h,
_ => {}
}
}