Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #433 from JuliaPlots/jk/single-point-conversion
Browse files Browse the repository at this point in the history
add single VecTypes conversion for point based plots
  • Loading branch information
SimonDanisch authored May 29, 2020
2 parents 705fd9d + 7d3671a commit dda52f8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/conversions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ function convert_arguments(T::PlotFunc, args...; kw...)
end
end

"""
Wrap a single point or equivalent object in a single-element array.
"""
function convert_arguments(::PointBased, position::VecTypes{N, <: Number}) where N
([convert(Point{N, Float32}, position)],)
end

function convert_arguments(::PointBased, positions::AbstractVector{<: VecTypes{N, <: Number}}) where N
(elconvert(Point{N, Float32}, positions),)
end
Expand Down

0 comments on commit dda52f8

Please sign in to comment.