mirror of
https://github.com/storytold/cadcraft.git
synced 2026-10-26 03:46:53 -06:00
TAN and PER snaps need the other end of the line, so the first point of a LINE (no base point yet) could never snap tangent: a belt line tangent to two circles was impossible to draw. Now, as in AutoCAD, a point prompt can accept *deferred* snaps: - snap: with no base and the new `deferred` flag, osnap offers "Deferred Tangent" (circles, arcs) and "Deferred Perpendicular" (circles, arcs, lines, xlines, rays) where no other snap wins. The hit carries the curve (`SnapHit::deferred`, `Deferred`, `SnapCurve`). - `resolve_deferred` solves the line once the other end is known: tangent or perpendicular from a point, tangent-to-tangent (common tangents of two circles, new `Circle::common_tangents` in geom) and the perpendicular mixes. Among several solutions the one nearest the picks wins. No solution (point inside the circle, concentric or nested circles, non-finite input) is `None`, never a panic. - prompt: `Prompt::deferred()` opts a prompt in; `Input::Deferred` reaches only such prompts, everywhere else the session turns it into the point it was picked at, so other commands snap as before. - LINE opts in for its first point (and the next one while the first is still deferred). No solution reports and re-prompts; Undo drops the deferred point. The rubber band shows the resolved line, also the tangent-to-tangent one while hovering the second curve (`Session::cursor_deferred`, set by the canvas). - canvas: passes the prompt's flag to osnap and sends a deferred pick as `Input::Deferred`. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>