Repository navigation
G1: Shift rotation and reflect honor Constrain Angle preference - #3046
Open
nrq6993-a11y wants to merge 2 commits into
Open
nrq6993-a11y wants to merge 2 commits into
nrq6993-a11y wants to merge 2 commits into
Conversation
Rotate, Free Transform, and bounding-box drags snap pointer direction in 45° steps from Preferences › General › Constrain Angle; Reflect matches. Co-authored-by: Cursor <cursoragent@cursor.com>
…ngle Like Illustrator, Shift now constrains the rotation itself (base + k·45°) rather than the pointer direction, so a drag that starts off a snap line still turns by a snapped angle. Reflect axis snapping is unchanged.
This branch has not been deployed
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.
G1: Shift rotation and reflect honor Constrain Angle preference
Summary
With Shift, bounding-box rotation (Selection tool, Free Transform) and Rotate-tool drags now snap the angle turned, as Illustrator does: the rotation lands on a multiple of 45° offset by Preferences › General › Constrain Angle (for example 30°, −15°, −60° with a 30° Constrain Angle), wherever the drag starts. Before, Shift snapped the pointer's direction, so a drag that did not start on a 45° line turned by an odd angle. Reflect-tool axis drags with Shift snap the axis direction to 45° steps from the same Constrain Angle, matching pen segments and direction handles. Part of gap G1 (rotation snap).
Note: touches the same Shift-rotate helper in tools/src/bbox.rs as #1298.
Plan
rotate_for_dragtakesbase_degand, with Shift, rounds the turned angle tobase_deg + k·45°cx.constrain_anglefrom Selection, Free Transform and Transform toolsconstrain_angle_fromwith the same base (axis direction, as in Illustrator)matrix_forcall sitesTests
cargo test -p vectorcraft-tools --lib— pass (440 passed, incl. the new off-snap-line test)cargo fmt -p vectorcraft-tools -- --check— passcargo clippy -p vectorcraft-tools --lib --tests -- -D warnings— passPart of gap G1
Status: Ready on
stream/vc-feat-g1-constrain-angle-transform(commit978f9000).Summary by CodeRabbit