Skip to content

Ctrl-drag to pull zero-length handles with angle locking #2620

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

0SlowPoke0
Copy link
Contributor

@0SlowPoke0 0SlowPoke0 commented Apr 25, 2025

Partially closes #1870

Ctrl-drag behavior for anchors (new since video was recorded):

  • If Ctrl is pressed before dragging begins, and the selected anchor has exactly one zero-length handle (i.e., one handle exists and the other doesn’t), dragging will pull out the zero-length handle, making it colinear with the opposite non-zero-length handle. The new handle will be locked to that angle during the drag.
  • This only applies to anchors with exactly two handles, where one is zero-length.
  • In all other cases, the Ctrl key is ignored and the anchor is dragged normally.
  • Additionally, if a non-endpoint anchor has no handles (both are zero-length), and Ctrl + Alt are both pressed before dragging, the handle being pulled out is locked to the angle of the line perpendicular to the average of the two tangents extending from that anchor to its adjacent curves.
    Reference Image

also fixes

If a single anchor is double clicked, and it has only one handle (the other is zero-length or doesn't exist), currently this converts it to sharp by removing the handle. But we want that to make the new handle colinear and extend it to an equal length as the present handle. Only if both handles are present, should double-clicking remove both handles like it does currently in that situation. And if both handles are gone, it should also do what it does now by restoring them as colinear.

@Keavon
Copy link
Member

Keavon commented Apr 27, 2025

!build

Copy link

📦 Build Complete for a2f96b1
https://8779b2aa.graphite.pages.dev

@Keavon
Copy link
Member

Keavon commented Apr 27, 2025

This seems to happen occasionally, where it changes angle:

capture_97_.mp4

It seems hard to replicate but I've done it a few times. Each time, it was from newly drawing a Pen tool layer, using the Path tool to select and Delete a handle, then upon the first attempt (as shown in the video) it would sometimes switch to a different angle (maybe due to a conflict with snapping?). Can you try and investigate further? Thanks.

@Keavon Keavon marked this pull request as draft April 29, 2025 22:53
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.

Tracking Issue: Pen and Path tool improvements
2 participants