From ae86ad75826c0e493824054fbd833bc436918d6a Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Sun, 14 Jun 2026 00:04:38 +0300 Subject: [PATCH] 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 --- src/modules/home/modify/trim.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/home/modify/trim.rs b/src/modules/home/modify/trim.rs index 7269afb16..505951a91 100644 --- a/src/modules/home/modify/trim.rs +++ b/src/modules/home/modify/trim.rs @@ -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, _ => {} } }