diff --git a/CHANGELOG.md b/CHANGELOG.md index 958c9d22511..601ad136683 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [Unreleased] - Correct a bug in the `project` function when projecting using a `Scene`. [#3909](https://github.com/MakieOrg/Makie.jl/pull/3909). +- Correct a method ambiguity in `insert!` which was causing `PlotList` to fail on CairoMakie. [#4038](https://github.com/MakieOrg/Makie.jl/pull/4038) ## [0.21.5] - 2024-07-07 diff --git a/CairoMakie/src/screen.jl b/CairoMakie/src/screen.jl index d9d23959c6d..e24b488332a 100644 --- a/CairoMakie/src/screen.jl +++ b/CairoMakie/src/screen.jl @@ -204,6 +204,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 +# to resolve method ambiguity, since this method is defined in Makie for MakieScreen and PlotList: +Base.insert!(screen::Screen, scene::Scene, plot::Plot{plotlist}) = nothing 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, diff --git a/CairoMakie/test/runtests.jl b/CairoMakie/test/runtests.jl index dd0c200495a..49158cdb546 100644 --- a/CairoMakie/test/runtests.jl +++ b/CairoMakie/test/runtests.jl @@ -134,6 +134,12 @@ end rm("test.mp4") end +@testset "plotlist no ambiguity (#4038)" begin + f = plotlist([Makie.SpecApi.Scatter(1:10)]) + Makie.colorbuffer(f; backend=CairoMakie) + plotlist!([Makie.SpecApi.Scatter(1:10)]) +end + excludes = Set([ "Colored Mesh",