Skip to content

Commit

Permalink
bring back matrix arguments for poly
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDanisch committed Aug 27, 2024
1 parent bdbed7c commit 017b696
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [Unreleased]

- Bring back `poly` convert arguments for matrix with points as row [#4266](https://github.com/MakieOrg/Makie.jl/pull/4258).

## [0.21.9] - 2024-08-27

- Hotfix for colormap + color updates [#4258](https://github.com/MakieOrg/Makie.jl/pull/4258).
Expand Down
3 changes: 3 additions & 0 deletions src/basic_recipes/poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ function convert_arguments(::Type{<:Poly}, path::BezierPath)
return convert_pointlike(path)
end

function convert_arguments(::Type{<:Poly}, path::AbstractMatrix{<:Number})
return convert_pointlike(path)
end

function convert_arguments(::Type{<:Poly}, vertices::AbstractArray, indices::AbstractArray)
return convert_arguments(Mesh, vertices, indices)
Expand Down
6 changes: 6 additions & 0 deletions test/conversions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,12 @@ end
@test pl.plots[1][1][][1] == Makie.poly_convert(points)
end

@testset "Poly with matrix" begin
x1 = [0.0, 1, 1, 0, 0]
y1 = [0.0, 0, 1, 1, 0]
@test convert_arguments(Poly, hcat(x1, y1))[1] == Point.(x1, y1)
end

@testset "GridBased and ImageLike conversions" begin
# type tree
@test GridBased <: ConversionTrait
Expand Down

0 comments on commit 017b696

Please sign in to comment.