MewPurPur / GodSVG

A vector graphics application for structured SVG editing, available on all major desktop platforms. Currently in late alpha.
https://godsvg.com
MIT License
1.18k stars 53 forks source link

Implement modifier keys for dragged handles #531

Open MewPurPur opened 6 months ago

MewPurPur commented 6 months ago

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:

ajreckof commented 5 months ago

Could also be good to have one for toggling snapping.

MewPurPur commented 5 months ago

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

ajreckof commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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

MewPurPur commented 5 months ago

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