diff --git a/CHANGELOG.md b/CHANGELOG.md index 63cf5738691..751c686d034 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Changelog ## [Unreleased] - +- Fix an error in `convert_arguments` for PointBased plots and 3D polygons [#4585](https://github.com/MakieOrg/Makie.jl/pull/4585). - Fix polygon rendering issue of `crossbar(..., show_notch = true)` in CairoMakie [#4587](https://github.com/MakieOrg/Makie.jl/pull/4587). ## [0.21.16] - 2024-11-06 diff --git a/src/conversions.jl b/src/conversions.jl index cfdd000a1ae..b7412d8340f 100644 --- a/src/conversions.jl +++ b/src/conversions.jl @@ -261,7 +261,7 @@ function convert_arguments(PB::PointBased, mp::Union{Array{<:Polygon{N, T}}, Mul converted = convert_arguments(PB, mp[idx])[1] # this should always be a Tuple{<: Vector{Point}} append!(arr, converted) if idx != n # don't add NaN at the end - push!(arr, Point2(NaN)) + push!(arr, Point{N, float_type(T)}(NaN)) end end return (arr,) diff --git a/test/convert_arguments.jl b/test/convert_arguments.jl index a075c27b133..70d2885aca6 100644 --- a/test/convert_arguments.jl +++ b/test/convert_arguments.jl @@ -132,6 +132,7 @@ Makie.convert_arguments(::PointBased, ::MyConvVector) = ([Point(10, 20)],) geom = Sphere(Point3{T_in}(0), T_in(1)) _mesh = GeometryBasics.mesh(rect3; pointtype=Point3{T_in}, facetype=GLTriangleFace) polygon = Polygon(Point2.(xs, ys)) + polygon3d = Polygon(Point3.(xs, ys, zs)) line = LineString(Point3.(xs, ys, zs)) bp = BezierPath([ MoveTo(T_in(0), T_in(0)), @@ -228,6 +229,9 @@ Makie.convert_arguments(::PointBased, ::MyConvVector) = ([Point(10, 20)],) @test apply_conversion(CT, polygon) isa Tuple{Vector{Point2{T_out}}} @test apply_conversion(CT, [polygon, polygon]) isa Tuple{Vector{Point2{T_out}}} @test apply_conversion(CT, MultiPolygon([polygon, polygon])) isa Tuple{Vector{Point2{T_out}}} + @test apply_conversion(CT, polygon3d) isa Tuple{Vector{Point3{T_out}}} + @test apply_conversion(CT, [polygon3d, polygon3d]) isa Tuple{Vector{Point3{T_out}}} + @test apply_conversion(CT, MultiPolygon([polygon3d, polygon3d])) isa Tuple{Vector{Point3{T_out}}} @test apply_conversion(CT, line) isa Tuple{Vector{Point3{T_out}}} @test apply_conversion(CT, [line, line]) isa Tuple{Vector{Point3{T_out}}} @test apply_conversion(CT, MultiLineString([line, line])) isa Tuple{Vector{Point3{T_out}}}