Skip to content

Commit ea9aa0d

Browse files
authored
Fix regression in rθ2uv() and also fix old bug. (#1925)
1 parent 8437d9d commit ea9aa0d

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

src/plot.jl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,13 +1135,17 @@ function helper_vecBug(d, arg1, first::Bool, haveR::Bool, haveVarFill::Bool, typ
11351135
end
11361136

11371137
function rθ2uv(arg1) # Convert to u,v
1138-
arg1 = convert(Array{Float64}, arg1) # We don't want to modify the original and need it Float64 anyway
1139-
for k = 1:size(arg1,1)
1140-
s, c = sincosd(arg1[k,3])
1141-
arg1[k,3] = arg1[k,4] * c
1142-
arg1[k,4] = arg1[k,4] * s
1138+
if (eltype(arg1) <: Integer)
1139+
_arg1 = mat2ds(convert(Array{Float64}, arg1))
1140+
else
1141+
_arg1 = deepcopy(arg1) # We don't want to modify the original
1142+
end
1143+
for k = 1:size(_arg1,1)
1144+
s, c = sincosd(_arg1[k,3])
1145+
_arg1[k,3] = _arg1[k,4] * c
1146+
_arg1[k,4] = _arg1[k,4] * s
11431147
end
1144-
return arg1
1148+
return _arg1
11451149
end
11461150

11471151
isArrowGMT4 = haskey(d, :arrow4) || haskey(d, :vector4)

0 commit comments

Comments
 (0)