Skip to content
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

Implement modifier keys for dragged handles #531

Open
MewPurPur opened this issue Feb 23, 2024 · 6 comments
Open

Implement modifier keys for dragged handles #531

MewPurPur opened this issue Feb 23, 2024 · 6 comments
Labels
approved Proposal is approved proposal

Comments

@MewPurPur
Copy link
Owner

MewPurPur commented Feb 23, 2024

What I'm currently thinking of is the following:

SHIFT = Move things along one axis compared to their original position, with a visual indicator on it. For the auxiliary handles of ellipses and rects, which can only move in one direction, force the aspect ratio to be the same as the one when you started dragging. For circles, V path commands, and H path commands, don't do anything.

CTRL = Aligning path handles at an angle to a previous one. I'm thinking of enabling this for each 15 degrees. This would work in limited situations:

  • LineTo path command if it's after another line-drawing path command (not including Z), for example to force a 45 degrees angle compared to the previous line.
  • Q or C command's first control, if the previous path command is S, C, T, or Q. This should also make Finalize GodSVG's logo #524 easier.
@ajreckof
Copy link
Contributor

Could also be good to have one for toggling snapping.

@MewPurPur
Copy link
Owner Author

I agree in theory, but I don't know how this would be implemented.

@ajreckof
Copy link
Contributor

You would need to first separate snap into two separate parameteres "snap_enabled" and "snap_increment". Then when moving in place of checking "snap_enabled" you also check for the key modifier. If you wish I could implement it.

@MewPurPur
Copy link
Owner Author

MewPurPur commented Mar 12, 2024

The implementation details aren't what I don't know about, I mean how it would work. Shift is commonly known to be axis-aligned moving and resizing things with preserved aspect ratio. Ctrl is commonly for snapping, but here I was thinking of something with aligning handles, both of which I find quite important to implement.

@ajreckof
Copy link
Contributor

maybe you can put the new behavior on another key modifier like ALT?

@MewPurPur
Copy link
Owner Author

I don't like ALT, but yeah that's the only thing that comes to mind.

@MewPurPur MewPurPur pinned this issue Apr 9, 2024
@MewPurPur MewPurPur added the approved Proposal is approved label May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Proposal is approved proposal
Projects
None yet
Development

No branches or pull requests

2 participants