Skip to content

Comments

Make the Pen tool close a path by double-clicking#3311

Open
krVatsal wants to merge 23 commits intoGraphiteEditor:masterfrom
krVatsal:add-feature-to-stop-drawing-on-double-click-using-pen-tool
Open

Make the Pen tool close a path by double-clicking#3311
krVatsal wants to merge 23 commits intoGraphiteEditor:masterfrom
krVatsal:add-feature-to-stop-drawing-on-double-click-using-pen-tool

Conversation

@krVatsal
Copy link
Contributor

Closes the active pen path when the user intentionally double-clicks.

Closes #3219

Signed-off-by: krVatsal <kumarvatsal34@gmail.com>
@timon-schelling
Copy link
Member

!build

@github-actions
Copy link

📦 Build Complete for 3fbcaf9
https://db70eac1.graphite.pages.dev

@krVatsal
Copy link
Contributor Author

Do i need to do something in order to get this pr reviewed?

@timon-schelling
Copy link
Member

No, everything fine we're just a bit behind on PRs, situation will improve when Keavon is back from vacation. Thanks for contributing :)

@krVatsal
Copy link
Contributor Author

Sure, thanks!

@timon-schelling
Copy link
Member

!build

@timon-schelling
Copy link
Member

Fails to compile now.

@timon-schelling timon-schelling marked this pull request as draft November 17, 2025 17:41
@krVatsal
Copy link
Contributor Author

Fails to compile now.

The conflicts are resolved , can you review this one also.

@timon-schelling
Copy link
Member

!build

@timon-schelling
Copy link
Member

!build

@github-actions
Copy link

📦 Build Complete for e4a80c5
https://31dfa54b.graphite.pages.dev

@timon-schelling
Copy link
Member

2026-01-13.18-10-26.mp4

Doesn't seem to work as expected.

@timon-schelling timon-schelling marked this pull request as draft January 13, 2026 18:13
@krVatsal
Copy link
Contributor Author

Can you clarify what is the desired output, drawing should end without closing the path or it should close the the shape on double click?

@timon-schelling
Copy link
Member

Closing the path, see the issue you linked.

Signed-off-by: krVatsal <kumarvatsal34@gmail.com>
@krVatsal
Copy link
Contributor Author

Closing the path, see the issue you linked.

Can you review it now?

@timon-schelling
Copy link
Member

!build

@github-actions
Copy link

📦 Build Complete for aa9da44
https://ab94894d.graphite.pages.dev

@timon-schelling timon-schelling changed the title Added feature to close shape path when double clicked using pen tool Close path with double clicked using pen tool Jan 25, 2026
@timon-schelling
Copy link
Member

LGTM, @0HyperCube any comments?

Copy link
Contributor

@0HyperCube 0HyperCube left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good.

I guess you could have bound an event for DoubleClick in the input_mappings.rs but that would confuse the logic since it happens only on mouse up.

@Keavon Keavon changed the title Close path with double clicked using pen tool Make the Pen tool close a path by double-clicking Jan 26, 2026
@Keavon
Copy link
Member

Keavon commented Jan 26, 2026

Yeah, from a behavioral perspective, this needs to not close the path upon releasing the mouse from a fast click-click-drag (double-clicking the mouse down part, but dragging during the second mouse down). Currently, that scenario results in unexpected behavior after mouse up.

@timon-schelling
Copy link
Member

!build

@github-actions
Copy link

📦 Build Complete for eec01d7
https://d159b349.graphite.pages.dev

@Keavon
Copy link
Member

Keavon commented Feb 16, 2026

This doesn't work as expected in the following case:

capture_16_.mp4

If there is clearly a single endpoint on the path being drawn, it should use that, not the starting point for the current drawing session. But if it attempts to find the endpoint but there is no single unambiguous one, because a vector mesh is involved in the currently-being-drawn subpath, then it should use the current behavior, for example this is correct:

capture_17_.mp4

@Keavon Keavon marked this pull request as draft February 16, 2026 19:52
@krVatsal
Copy link
Contributor Author

Got it, will improve this.

@krVatsal krVatsal marked this pull request as ready for review February 17, 2026 10:19
@Keavon
Copy link
Member

Keavon commented Feb 18, 2026

I'd like it so if you accidentally double-click, you can hit Ctrl+Z and return to the drawing state you were in immediately before you double-clicked. This already works for regular segment drawing, where you can hit Ctrl+Z to undo each segment and continue where you were immediately before drawing each segment, still interactively placing the next segment. That's how we'd like to work after double-clicking and hitting Ctrl+Z.

@Keavon Keavon marked this pull request as draft February 18, 2026 08:03
@krVatsal
Copy link
Contributor Author

krVatsal commented Feb 18, 2026

Should it behave like: when we hit Ctrl+Z(after closing path) then we can continue drawing without clicking again on the last node? If it is so, then if we keep hitting Ctrl+Z again and again it should be able to continue drawing without clicking again on the last node, which is not the current situation with pen tool after a certain number of undos.

Is this a desired condition to reduce overhead or a bug?

Recording.2026-02-18.193421.1.mp4

@Keavon
Copy link
Member

Keavon commented Feb 18, 2026

You've encountered the same bug I noticed a couple of times, but was not able to reproduce reliably. If you can help debug that and solve it also, that would be really helpful. It doesn't have to be part of this PR.

@krVatsal krVatsal marked this pull request as ready for review February 19, 2026 11:31
@krVatsal
Copy link
Contributor Author

You've encountered the same bug I noticed a couple of times, but was not able to reproduce reliably. If you can help debug that and solve it also, that would be really helpful. It doesn't have to be part of this PR.

Sure i will open a new issue for this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Close Pen Tool path with double click

4 participants