Repository navigation
ARC: hold Ctrl (Cmd on macOS) to switch direction in every variant - #12
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)".crates/ui-egui/src/canvas.rs:Session::ctrl_downis Ctrl everywhere, plus Cmd on macOS (mac_cmd/command).ui.modifiers {ctrl?, cmd?, shift?, alt?}holds modifiers across synthetic pointer moves (documented indocs/control-protocol.md).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 setctrl_down; Shift alone does not.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