We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f1b7739 commit 5ca4060Copy full SHA for 5ca4060
editor/src/messages/tool/tool_messages/gradient_tool.rs
@@ -351,7 +351,8 @@ impl Fsm for GradientToolFsmState {
351
let (start, end) = (transform.transform_point2(gradient.start), transform.transform_point2(gradient.end));
352
353
// Compute the distance from the mouse to the gradient line in viewport space
354
- let distance = (end - start).angle_to(mouse - start).sin() * (mouse - start).length();
+ let direction = (end - start).normalize_or_zero();
355
+ let distance = direction.dot(mouse - start);
356
357
// If click is on the line then insert point
358
if distance < (SELECTION_THRESHOLD * 2.) {
0 commit comments