Skip to content

Commit

Permalink
Merge pull request #191 from MakieOrg/hw/fixnanangles
Browse files Browse the repository at this point in the history
fix NaN angles
  • Loading branch information
hexaeder authored Jul 18, 2024
2 parents 5839721 + 3e9908d commit 1c73b75
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/recipes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ function Makie.plot!(gp::GraphPlot)
to_angle = @lift (path, p0, t) -> begin
# TODO: maybe shorter tangent? For some perspectives this might give wrong angles in 3d
p1 = p0 + tangent(path, t)
any(isnan, p1) && return 0.0 # lines with zero lengths might lead to NaN tangents
tpx = $to_px(p1) - $to_px(p0)
atan(tpx[2], tpx[1])
end
Expand Down

0 comments on commit 1c73b75

Please sign in to comment.