Repository navigation
Free Transform: a handle drag follows the modifiers held during the drag - #269
Merged
bflatastic merged 3 commits intoOct 7, 2026
Merged
Conversation
… works A double-click on a tool button runs tool.options, which only knew a few tools, so the common double-clicks did nothing: the Hand tool now fits the artboard in the window, the Zoom tool shows 100%, and Rotate, Scale, Reflect and Shear open their Object > Transform dialog (when something is selected, like the menu items). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ting shows its artboard The navigator's buttons were painted only and its number was always 1, and Fit Artboard in Window and Actual Size always used the first artboard. The per-document View now keeps the navigator's artboard; the new view.goToArtboard UI command (an index, or first / previous / next / last) sets it and fits it in the window, and the four buttons call it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… handle drag The tool chose scale, distort, perspective or shear from the modifiers at the press only, but a Cmd press on the canvas is the temporary Selection tool, and the documented gesture is to start dragging and then hold Cmd. A handle drag now follows the modifiers held during the drag; when the operation changes, the interaction restarts so the undo step is named after what was done. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bflatastic
force-pushed
the
fix/free-transform-modifiers
branch
from
October 7, 2026 05:31
649479d to
614606c
Compare
Member
|
Thanks @theironchef, merged! I rebased it on main and updated the ROADMAP's Free Transform entry. Re-deriving the operation from the keys held on every drag, and restarting the step only when its name changes, keeps a single, correctly named undo step. Nicely tested. |
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.
Fixes #268.
Problem:
FreeTransformTool(crates/tools/src/xform/free.rs) chose scale, free distort, perspective distort or shear from the modifiers on the press only. In the app neither key order reaches those modes:So with the mouse, the tool could only scale, rotate and move. The
cmd_side_handle_shearsunit test sent Cmd with the press, which the canvas never delivers.Change
handle_op, whichclassifystill uses on the press.Drag, a handle drag now re-derives its operation from the modifiers held at that moment:Canceland thenBeginwith the new name, so the single undo step is named after what was done ("Distort" rather than "Scale"). Previews already re-apply on top of the snapshot, so switching betweenobject.transformandobject.distortmid-drag is safe.modeoption are unchanged.Opgainshandle()andlabel(), replacing the inline labelmatch.Tests
xform::free::tests::modifiers_pressed_during_a_handle_drag_change_what_it_does:Cancel, Begin("Distort"), Preview(object.distort …)when Cmd comes in;tests_xform::free_transform_cmd_held_once_a_corner_drag_started_distorts_in_one_step: through the session, the dragged corner lands on the pointer, the other three corners stay, and History gains exactly one "Distort" step.cargo test -p vectorcraft-tools: 186 passed.cargo test -p vectorcraft-engine --lib: 1237 passed.cargo clippy -p vectorcraft-tools -p vectorcraft-engine --all-targets -- -D warnings(Rust 1.99): clean.cargo fmt --all -- --check: clean.I didn't run the full
cargo xtask ci(wasm step) here.🤖 Generated with Claude Code