Add snapping to endpoints and stops in the Gradient tool#3732
Add snapping to endpoints and stops in the Gradient tool#3732Keavon merged 5 commits intoGraphiteEditor:masterfrom
Conversation
editor/src/messages/portfolio/document/overlays/utility_types_native.rs
Outdated
Show resolved
Hide resolved
editor/src/messages/portfolio/document/overlays/utility_types_native.rs
Outdated
Show resolved
Hide resolved
|
This kind of snapping doesn't actually snap: capture_10_.mp4It would need to calculate the color stop position where the gradient line intersects the snapping target line and snap it to that position when the snap is active, since the whole point of a snap is to take the precise mouse movements surrounding a target and jump them all to the exact value. This also occurs when dragging an endpoint when Shift is held to snap to a 15° angle increment. Note that the Line tool's implementation of this same behavior does work as expected when you're dragging a line's endpoint and holding Shift or Ctrl to lock the angle: capture_11_.mp4The snapping tolerance for this scenario is more sane in the Line tool (smaller tolerance area) than it is for the Gradient tool (too large of a tolerance area, should match Line tool's behavior). This is something I'm willing to wait on for a followup PR, if you prefer. |
|
!build (Run ID 22273628463) |
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds snapping functionality to the gradient tool, allowing gradient handles and color stops to snap to various points and paths. The changes introduce new snap sources for gradients and integrate snapping logic into the gradient tool's state machine. My review focuses on code duplication and opportunities for minor refactoring to improve readability and maintainability.
|
I fixed the bugs since I want to get this merged. |
Closes #3261