From 887848e17a3998887ffe49fd2b2cef7389bc7bc5 Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Wed, 7 Feb 2024 11:15:17 -0500 Subject: [PATCH 1/3] Resolve method ambiguity when inserting PlotList to CairoScreen --- CairoMakie/src/screen.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CairoMakie/src/screen.jl b/CairoMakie/src/screen.jl index 588159df2b4..68eab1ba7ff 100644 --- a/CairoMakie/src/screen.jl +++ b/CairoMakie/src/screen.jl @@ -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, From 11fc84282a768658b6b1546ca3994d801e217e71 Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Wed, 7 Feb 2024 11:25:40 -0500 Subject: [PATCH 2/3] Add a reference image test so all backends are tested --- ReferenceTests/src/tests/recipes.jl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ReferenceTests/src/tests/recipes.jl b/ReferenceTests/src/tests/recipes.jl index 547920a0538..1d7ddbf9e97 100644 --- a/ReferenceTests/src/tests/recipes.jl +++ b/ReferenceTests/src/tests/recipes.jl @@ -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 \ No newline at end of file From d6ba81a4dbdae2c18ddb014247b5e7d1f42c39d9 Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Wed, 7 Feb 2024 22:19:21 +0530 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb5e8be46f4..39627999f92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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