Gradient tool snapping with locked angle
Author: 0HyperCubeCreated Sep 26, 2026Updated Sep 26, 2026
Reproduction
- New document
- Draw rectangle
- Use the gradient tool to draw a gradient
- Press Ctrl or Shift to lock the angle
- Observe how the snapping to the rectangle no longer occurs and any old overlays get stuck until finishing the drag
Video
https://github.com/user-attachments/assets/de604938-8d10-46bd-917b-4ac8a09dde3a
Relevant code
The line tool uses SnapConstraint::Line to snap when constrained to an angle:
https://github.com/GraphiteEditor/Graphite/blob/f7562b6fd7428f887ba8ed833692535ad9b94ec4/editor/src/messages/tool/common_functionality/shapes/line_shape.rs#L157-L164
The gradient tool completely ignores snapping when an angle constraint exists: https://github.com/GraphiteEditor/Graphite/blob/f7562b6fd7428f887ba8ed833692535ad9b94ec4/editor/src/messages/tool/tool_messages/gradient_tool.rs#L599-L610 https://github.com/GraphiteEditor/Graphite/blob/f7562b6fd7428f887ba8ed833692535ad9b94ec4/editor/src/messages/tool/tool_messages/gradient_tool.rs#L631
Source: GraphiteEditor/Graphite