Skip to content

Commit

Permalink
Merge pull request #894 from Tomostfe/master
Browse files Browse the repository at this point in the history
Removed panic when mouse is on origin of arrow. Solves #810
  • Loading branch information
JoshuaBatty committed Jan 22, 2023
2 parents 8914323 + 32c2c93 commit e375ea7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/draw/draw_arrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn view(app: &App, frame: Frame) {
let start = r.xy();
let start_to_mouse = app.mouse.position() - start;
let target_mag = start_to_mouse.length().min(side * 0.5);
let end = start + start_to_mouse.normalize() * target_mag;
let end = start + start_to_mouse.normalize_or_zero() * target_mag;
draw.arrow().weight(5.0).points(start, end);
}
}
Expand Down

0 comments on commit e375ea7

Please sign in to comment.