Repository navigation
Fix #798: the Curvature tool edits any selected path - #891
Merged
Merged
Conversation
The Curvature tool only edited the path it was drawing. It now edits any selected path, whatever drew it, keeping its shape except where edited: a click on a point makes it the current (direct-selected) point and a drag moves it, re-curving only its two segments (the neighbours keep their handle directions); Alt-click or double-click toggles it smooth or corner and Delete removes it; a click on a segment adds a smooth point without changing the shape, and a drag moves it in the same undo step. With an end of an open path current, clicks go on from it (the old segments keep their shape) and a click on the other end closes it. The edits go through a new path.curvatureEdit command (move, insert, extend, close), path.convertAnchor and path.removeAnchor, one undo step each. The tool now claims Delete/Backspace while it has a point to remove, so the key no longer deletes the whole path. 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.
Fixes #798.
The Curvature tool only edited the path it was drawing. It now works on any selected path, whatever drew it, and changes nothing outside the edit:
path.convertAnchor); Delete/Backspace removes the current point (path.removeAnchor). The tool now claims Delete while it has a point to remove: before, Delete removed the whole path even while drawing.New command:
path.curvatureEdit {id, subpath?, op: "move"|"insert"|"extend"|"close", anchor?, segment?, t?, end?, from?, x?, y?}, one undo step, every parameter checked, so agents can make the same edits (docs/mcp.md › Editing a path with the Curvature tool).editable_pathsmoved from the Pen todraw2so both tools share it.Tested:
cargo xtask ci(all 7 steps), on its own and stacked with PNG export: anti-aliased edges of semi-transparent art come out at alpha 254 over an opaque background, so the file is written as RGBA #787.curvature.rs(moved points leave other segments bit-identical; continuing and closing keep old segments; inserting keeps the shape), an engine test that each edit on a Pen path is one undo step, and junk-parameter cases incommand_sweep.rs.🤖 Generated with Claude Code