From 39c0a84c3c55a9a2a23bc003ba5220a2257df342 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Thu, 9 Jul 2026 20:59:46 +0300 Subject: [PATCH] feat(arc): keep ARC Continue drawing arcs until ended (#327) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Continue option committed a single tangent-continuing arc and left the command. Now each picked end point commits its arc and re-anchors at that arc's free end, so the user keeps drawing tangent-continuing arcs until ending the run with Enter/Esc. A degenerate (collinear) pick stays active instead of cancelling. Because arcs now commit via CmdResult::CommitEntity (repeating) rather than CommitAndExit, advance the ARC_CONT continuation anchor in the CommitEntity arm too — guarded to line/arc so non-continuable repeats (point/ray/spline) leave it untouched. This also lets a LINE run feed a following ARC Continue. Co-Authored-By: Claude Opus 4.8 --- src/app/command_driver.rs | 11 +++++++++++ src/modules/draw/draw/arc.rs | 14 ++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/app/command_driver.rs b/src/app/command_driver.rs index e6a4007b8..58d352c2a 100644 --- a/src/app/command_driver.rs +++ b/src/app/command_driver.rs @@ -218,6 +218,17 @@ impl OpenCADStudio { } } CmdResult::CommitEntity(entity) => { + // A line/arc drawn by a repeating command advances the ARC_CONT + // continuation anchor, so ending one run and launching another + // keeps continuing from the last segment (mirrors the + // CommitAndExit arm). Non-continuable repeats (point/ray/spline) + // leave the anchor untouched. (#327) + if matches!( + entity, + acadrust::EntityType::Line(_) | acadrust::EntityType::Arc(_) + ) { + self.update_cont_anchor(&entity); + } let label = self.history_label_from_active_cmd(i, "ENTITY"); self.push_undo_snapshot(i, label); self.commit_entity(entity); diff --git a/src/modules/draw/draw/arc.rs b/src/modules/draw/draw/arc.rs index fa4a4c86f..80b5abfcb 100644 --- a/src/modules/draw/draw/arc.rs +++ b/src/modules/draw/draw/arc.rs @@ -1359,9 +1359,19 @@ impl CadCommand for ArcContCommand { fn on_point(&mut self, pt: DVec3) -> CmdResult { match arc_continue(self.s, self.tangent, pt, self.ctrl) { Some((center, radius, sa, ea)) => { - CmdResult::CommitAndExit(make_arc(center, radius, sa, ea)) + let arc = make_arc(center, radius, sa, ea); + // Keep drawing: re-anchor at the arc just committed so the next + // click starts another tangent-continuing arc from its end, + // until the user ends the run with Enter/Esc (#327). + if let Some((end, tangent)) = continue_anchor(&arc, Some(pt)) { + self.s = end; + self.tangent = tangent; + } + CmdResult::CommitEntity(arc) } - None => CmdResult::Cancel, + // A degenerate pick (no arc through these points) shouldn't end the + // whole run — stay active and wait for the next end point. + None => CmdResult::NeedPoint, } } fn on_enter(&mut self) -> CmdResult {