Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CairoMakie erroring when recipes return lists of PlotSpec #3612

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## [Unreleased]

- Fixed an issue where CairoMakie would unnecessarily rasterize polygons [#3605](https://github.com/MakieOrg/Makie.jl/pull/3605).
- Fixed a method ambiguity in CairoMakie when plotting lists of PlotSpecs (`plotlist`) [#3612](https://github.com/MakieOrg/Makie.jl/pull/3612).
- Added `PointBased` conversion trait to `scatterlines` recipe [#3603](https://github.com/MakieOrg/Makie.jl/pull/3603).

## [0.20.7] - 2024-02-04
Expand Down
2 changes: 2 additions & 0 deletions CairoMakie/src/screen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ Base.size(screen::Screen) = round.(Int, (screen.surface.width, screen.surface.he
# we render the scene directly, since we have
# no screen dependent state like in e.g. opengl
Base.insert!(screen::Screen, scene::Scene, plot) = nothing
Base.insert!(screen::Screen, scene::Scene, plot::Plot{Makie.plotlist}) = nothing # resolve ambiguity

function Base.delete!(screen::Screen, scene::Scene, plot::AbstractPlot)
# Currently, we rerender every time, so nothing needs
# to happen here. However, in the event that changes,
Expand Down
13 changes: 13 additions & 0 deletions ReferenceTests/src/tests/recipes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,16 @@ end
molecule_plot[:advance] = i
end
end

@reference_test "PlotList support" begin
struct PlotlistTestType end
Makie.plottype(::PlotlistTestType) = Makie.Lines
function Makie.convert_arguments(::Type{<: Makie.Lines}, obj::PlotlistTestType)
return [
Makie.SpecApi.Lines([0, 1], [0, 1]),
Makie.SpecApi.Scatter([0.5], [0.5]),
]
end
plot(PlotlistTestType())
end
end
Loading