Skip to content

Commit

Permalink
fix quiver_using_hack
Browse files Browse the repository at this point in the history
  • Loading branch information
BeastyBlacksmith committed Sep 13, 2022
1 parent a9e4f92 commit 136552f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/recipes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,7 @@ function quiver_using_hack(plotattributes::AKW)
# get the starting position
xi = _cycle(xorig, i)
yi = _cycle(yorig, i)
p = P2(xi, yi)
p = P2((xi, yi))

# get the velocity
vi = _cycle(velocity, i)
Expand All @@ -1329,22 +1329,21 @@ function quiver_using_hack(plotattributes::AKW)
else
error("unexpected vi type $(typeof(vi)) for quiver: $vi")
end
v = P2(vx, vy)
v = P2((vx, vy))

dist = norm(v)
arrow_h = 0.1dist # height of arrowhead
arrow_w = 0.5arrow_h # halfwidth of arrowhead
U1 = v ./ dist # vector of arrowhead height
U2 = P2(-U1[2], U1[1]) # vector of arrowhead halfwidth
U1 *= arrow_h
U2 *= arrow_w
U2 = P2((-U1[2], U1[1])) # vector of arrowhead halfwidth
U1 = U1 .* arrow_h
U2 = U2 .* arrow_w

ppv = p + v
nanappend!(pts, P2[p, ppv - U1, ppv - U1 + U2, ppv, ppv - U1 - U2, ppv - U1])
ppv = p .+ v
nanappend!(pts, P2[p, ppv .- U1, ppv .- U1 .+ U2, ppv, ppv .- U1 .- U2, ppv .- U1])
end

plotattributes[:x], plotattributes[:y] = RecipesPipeline.unzip(pts[2:end])
# KW[plotattributes]
end

# function apply_series_recipe(plotattributes::AKW, ::Type{Val{:quiver}})
Expand Down

3 comments on commit 136552f

@BeastyBlacksmith
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/68179

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.33.0 -m "<description of version>" 136552f91481762da9aaf92469509809c2f360a6
git push origin v1.33.0

@t-bltg
Copy link
Member

@t-bltg t-bltg commented on 136552f Sep 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BeastyBlacksmith, SnoopCompile on 1.6 and 1.7 is broken.

Please sign in to comment.