Repository navigation
Conversation
The drag handler records the grabbed chain node and its starting x coordinate. Once the node detaches and the queued grid shifts finish, it applies the remaining horizontal displacement once and refreshes the node and wire positions. Alt-drag duplication clears the saved grab so the correction cannot move the original node. A regression test covers detachment in both directions, a straight vertical drag, an unchained node, and cancellation. Fixes GraphiteEditor#4978
|
This PR's title needs revising to follow the project's conventions:
Suggested titles: Editing the title reviews it again. |
Member
|
This should now be fixed, can you confirm by checking https://dev.graphite.art ? |
Author
|
Closing this: superseded by #5007. Happy to port the work if you still want it. |
Member
|
@mvanhorn thanks for the pr, but I don't think this should be necassary any more since I changed how the snapping / movement works such that we compute the layout for every drag frame as a pure function from the initial state + drag offset so we should never get a situation where this issue could even occur since the drag history does not influence the layout |
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.
Why
After a sideways drag along a Merge row, pulling the node out of the row leaves the cursor to one side of the original grab point. That offset persists as the drag continues.
The drag handler counts horizontal grid movement even while the row constrains the node’s position. Once the node detaches, the handler applies only subsequent movement, so the node never catches up with the cursor.
What changed
The drag handler records the grabbed chain node and its starting x coordinate. Once the node detaches and the queued grid shifts finish, it applies the remaining horizontal displacement once and refreshes the node and wire positions. Alt-drag duplication clears the saved grab so the correction cannot move the original node. A regression test covers detachment in both directions, a straight vertical drag, an unchained node, and cancellation.
Testing
cargo test -q --manifest-path editor/Cargo.toml -p graphite-editorstopped before running tests because the editor requires rustc 1.98 and the installed version was 1.97.1. A run with the Graphite NodeGraphMessageHandler change reverted gave no clear result, so no test is shown to catch this bug.Fixes #4978
AI was used for assistance.