-
-
Notifications
You must be signed in to change notification settings - Fork 1k
fix: joining paths from different layers with Ctrl+J fails #3534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix: joining paths from different layers with Ctrl+J fails #3534
Conversation
|
Hello and thanks for the PR. I need to mention that we do not accept PR descriptions written by AI because they increase the noise-to-signal ratio and usually serve to mislead with obscured inaccuracies. (The same applies to code, which must be written by you.) |
|
Oh, hey , I had this extension turned on in my IDE https://whatthediff.ai/ , will be mindful to disable it when creating PRs in this repo :) . Also regarding using AI in code, I did use claude code for targeting the files and the fix but did review that intensively before publishing . |
|
Thanks for the insight into your process (we've been seeing more highly-elaborate-but-not-insightful PR descriptions like this and it's good to know some of the details about what kinds of AI tools are producing them). For code authorship, AI is acceptable for auto-completing lines you would already be typing, but we need contributions to always come from the original thought processes of its human authors who can answer to the reasoning behind each line of changes. Code can't be mysteriously changed without anyone aware of why the change was made. Thanks for working to follow our requirements to building an effective software project. |
0HyperCube
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't work. I have tried it with some simple lines with a transform.
I guess the vibes haven't fully completed the code.
cannot_join_lines_with_transform.mp4
|
Taking a look |
When using Ctrl+J to join two points from different layers, the operation failed because PointIds change during merge due to collision resolution. The fix uses index-based point tracking instead of PointIds: 1. Before merge: Record the index of each selected point in its layer 2. Calculate post-merge indices using the point offset from layer1 3. After merge: Retrieve the actual PointIds at those indices 4. Create the connecting segment using the resolved PointIds This works because Vector::concat() preserves point ordering during merge, so we can use exact index arithmetic to find points after remapping. Fixes GraphiteEditor#3519
27f0b7b to
d604ef6
Compare
|
After taking a second look at the issue, here is what I came up with: The fix uses index-based tracking to handle PointId remapping:
Other approaches I considered:
|
|
Let me know if I am missing something or if there could be any other edge case here |
Screen.Recording.2025-12-28.at.7.12.43.AM.movMore manual testing with data grid for when the conflicting PointId is not updated so the wrong segment is created , here it is not created . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fail_with_repeat.mp4
However I guess it doesn't matter too much.
|
Taking a look , also agreed , you are good at finding these edge cases :) |
Summary
Screen.Recording.2025-12-28.at.3.44.52.AM.mov
Fixes #3519
Instead of tracking PointIDs (which get remapped), we track point positions in the list. When Vector::concat() merges two layers, it preserves order:
Below is a shorter version of the fix :