Skip to content

ARC: hold Ctrl (Cmd on macOS) to switch direction in every variant - #12

Merged
SkryxDev merged 1 commit into
mainfrom
fix/arc-ctrl-direction
Nov 11, 2026
Merged

SkryxDev merged 1 commit into
mainfrom
fix/arc-ctrl-direction

Conversation

@SkryxDev

Copy link
Copy Markdown
Member

Problem

Drawing an arc start → Center → end point, the arc always went counter-clockwise to the cursor; holding Ctrl (or Cmd on a Mac) did nothing, so the lower-right quadrant in the reported case could not be reached the way AutoCAD allows.

Ctrl was only wired into Center,Start,End and Continue. Start,Center,End — the usual path — and the angle, chord-length, Start,End,Center and radius variants ignored it. On macOS the canvas read only the physical Ctrl key, never Cmd.

Change

  • crates/engine/src/cmd/draw2/arc.rs: while Ctrl is held, every variant AutoCAD lets Ctrl reverse goes clockwise from the start, in the rubber band and in the arc the click creates; the last prompt of each says "(hold Ctrl to switch direction)".
    • start/center/end picked (SCE, SEC, CSE): same circle, start/end angles swapped;
    • included angle (SCA, CSA): a picked angle is measured clockwise so the arc still ends on the cursor ray; a typed angle is negated;
    • chord length (SCL, CSL): same chord, clockwise from the start;
    • start, end and angle or radius (SEA, SER): the same arc mirrored across the chord.
    • Three-point and tangent-direction arcs keep ignoring Ctrl (as AutoCAD).
  • crates/ui-egui/src/canvas.rs: Session::ctrl_down is Ctrl everywhere, plus Cmd on macOS (mac_cmd/command).
  • Control channel: new ui.modifiers {ctrl?, cmd?, shift?, alt?} holds modifiers across synthetic pointer moves (documented in docs/control-protocol.md).
  • The four new prompt strings are translated in all 17 catalogs that had the base prompt.

Tests

  • crates/engine/tests/it/arc_ctrl_direction.rs: every variant drawn with and without Ctrl; the Ctrl arc relates to the plain one as described above, and the previewed arc equals the created one. Three-point and direction arcs are unchanged by Ctrl.
  • canvas::tests::ctrl_or_cmd_held_reaches_the_session: Ctrl, Cmd and Command set ctrl_down; Shift alone does not.
  • Checked in the running app (Italian UI) through the control channel: holding Cmd flips the preview to the short clockwise arc and the click creates it (start 288.4°, end 0°, center 0,0, r 10).
  • cargo xtask ci: fmt, clippy, i18n, assets, layers and wasm pass; tests pass except the three known macOS-only failures (usage::non_unicode_output_names, read_file_refuses_a_name_that_is_not_unicode, thai_marks_stack_in_an_installed_font).

🤖 Generated with Claude Code

Ctrl only reversed Center,Start,End and Continue. Start,Center,End (the
usual path: start point, Center option, end point) ignored it, as did the
angle, chord-length, Start,End,Center and radius variants. Each of these
now goes clockwise from the start while Ctrl is held, in the rubber band
and in the arc the click creates, and its last prompt says so as
AutoCAD's does:

- start/center/end picked: same circle, start and end angles swapped;
- included angle: a picked angle is measured clockwise so the arc still
  ends on the cursor ray, a typed one is negated;
- chord length: the same chord, clockwise from the start;
- start, end and angle or radius: the same arc mirrored across the chord.

The three-point and tangent-direction forms keep ignoring Ctrl.

On macOS Cmd now counts too (egui's `mac_cmd`/`command`): Ctrl-click
there can become a right click. The control channel gains `ui.modifiers`
to hold modifier keys across synthetic moves, which is how this was
checked in the running app.

New prompts are translated in every catalog that had the base prompt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SkryxDev
SkryxDev merged commit 275f462 into main Nov 11, 2026
1 check passed
@SkryxDev
SkryxDev deleted the fix/arc-ctrl-direction branch November 11, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant