-
Notifications
You must be signed in to change notification settings - Fork 58
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
#5339 Add tangent snapping to straight segment tool #5995
base: main
Are you sure you want to change the base?
#5339 Add tangent snapping to straight segment tool #5995
Conversation
…aight-segment-tool
…aight-segment-tool
…aight-segment-tool
…aight-segment-tool
…aight-segment-tool
…aight-segment-tool
…aight-segment-tool
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
QA Wolf here! As you write new code it's important that your test coverage is keeping up. |
…aight-segment-tool
…aight-segment-tool
…aight-segment-tool
Thanks for the thorough write-up on this! Reviewing now |
…aight-segment-tool
This is super exciting. Checking out locally now |
Really promising stuff. I think that the code mod that gets written just needs to be changed a little bit. Right now you're writing code like
There should be helper functions for generating a tag for the previous segment for use in the Screenshare.-.2025-03-28.9_26_12.AM-compressed.mp4 |
I'd also love to have a test for some of this functionality. There are examples of snapping logic tests in the code base like this one that could be extended or copied from, and |
@franknoirot thanks that's very useful! To confirm, I should only use Also good point about snapping to horizontal / vertical axes, let me know if I should add that to this PR? It doesn't seem too big to implement. I was thinking of drawing an extra long (dashed?) line as well in the tangent direction to emphasize the snapping. And yes, adding tests to this as well. |
Implements #5339
When drawing a straight segment, if the previous segment was an arc, the straight segment is snapping to the outgoing tangent direction of that previous arc.
When both axis and tangent direction intersects then the snapped point is that intersection.
I used a threshold in screen space pixel size to determine snapping and introduced a few hotkeys:
Possible further improvements:
Both of these can be done but I wanted to make sure it's worth the time spent on it, especially as these hotkeys were not even in the spec for the original issue.
There is potentially a more general task here about unifying snapping logic: