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

Layer and grid snapping systems #1521

Merged
merged 21 commits into from
Jan 13, 2024
Merged

Layer and grid snapping systems #1521

merged 21 commits into from
Jan 13, 2024

Conversation

0HyperCube
Copy link
Member

@0HyperCube 0HyperCube commented Dec 19, 2023

Closes #1206 closes #318 closes #633

Functionality

  • Free snapping
  • Contrained snapping (e.g. drag on one axis with select, or constrained aspect ratio with rectangle tool)

Tools

  • Select
  • Path
  • Pen
  • Line
  • Rect
  • Circle
  • Shape

Bounds snapping

  • edges
  • corners
  • edge midpoints
  • centres
  • overlays

Node snapping

  • paths
  • path_intersections
  • cusp_nodes
  • smooth_nodes
  • line midpoints
  • normals
  • tangents
  • overlays

Grid snapping

  • to line
  • to intersections
  • overlays
  • Customise offset and size
  • isometric grid

@Keavon Keavon force-pushed the snapping branch 2 times, most recently from 82eddac to eb62315 Compare December 20, 2023 13:46
@Keavon Keavon changed the title Snapping system Layer and grid snapping systems Jan 8, 2024
@otdavies
Copy link
Member

otdavies commented Jan 12, 2024

Amazing work, really excited to see the isometric especially.

Note: Going to zero or negative spacing seems to cause an editor freeze.

@otdavies
Copy link
Member

otdavies commented Jan 12, 2024

Another note:

Looks like in certain situations while scaling there is a jumpy / jittery behavior while snapping..
Example:
https://github.com/GraphiteEditor/Graphite/assets/3145170/31f2cb9b-102d-4212-9797-8e1d7ece408a

File (remove the .json): example.graphite.json

@0HyperCube
Copy link
Member Author

Note: Going to zero or negative spacing seems to cause an editor freeze.

Fixed @otdavies

Looks like in certain situations while scaling there is a jumpy / jittery behavior while snapping..

This was caused by a NaN being produced when calculating the X distance. I added a check to avoid this and fix the behaviour.

Copy link
Member

@Keavon Keavon left a comment

Choose a reason for hiding this comment

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

Freakin' amazing!

@Keavon Keavon enabled auto-merge (squash) January 13, 2024 14:30
@Keavon Keavon merged commit 456ca17 into master Jan 13, 2024
3 checks passed
@Keavon Keavon deleted the snapping branch January 13, 2024 14:32
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.

Layer-to-layer snapping system Snapping to vector edges/curves Grid snapping system
3 participants