fixes two checks for 3D to work properly.

This commit is contained in:
Ronny Bergmann 2020-11-13 09:29:43 +01:00
parent d3f2a55b59
commit abebbdd54a

View File

@ -1197,7 +1197,7 @@ function quiver_using_arrows(plotattributes::AKW)
if !isa(plotattributes[:arrow], Arrow) if !isa(plotattributes[:arrow], Arrow)
plotattributes[:arrow] = arrow() plotattributes[:arrow] = arrow()
end end
is_3d = haskey(plotattributes,:z) is_3d = haskey(plotattributes,:z) && !isnothing(plotattributes[:z])
velocity = error_zipit(plotattributes[:quiver]) velocity = error_zipit(plotattributes[:quiver])
xorig, yorig = plotattributes[:x], plotattributes[:y] xorig, yorig = plotattributes[:x], plotattributes[:y]
zorig = is_3d ? plotattributes[:z] : [] zorig = is_3d ? plotattributes[:z] : []
@ -1205,7 +1205,7 @@ function quiver_using_arrows(plotattributes::AKW)
# for each point, we create an arrow of velocity vi, translated to the x/y coordinates # for each point, we create an arrow of velocity vi, translated to the x/y coordinates
x, y = zeros(0), zeros(0) x, y = zeros(0), zeros(0)
is_3d && ( z = zeros(0)) is_3d && ( z = zeros(0))
for i = 1:max(length(xorig), length(yorig), length(zorig)) for i = 1:max(length(xorig), length(yorig), is_3d ? 0 : length(zorig))
# get the starting position # get the starting position
xi = _cycle(xorig, i) xi = _cycle(xorig, i)
yi = _cycle(yorig, i) yi = _cycle(yorig, i)