Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #251 from JuliaPlots/sd/delete
Browse files Browse the repository at this point in the history
implement delete plot from scene
  • Loading branch information
SimonDanisch authored Dec 10, 2019
2 parents 420fa25 + b6ab825 commit 7e3c3ea
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/scenes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,21 @@ function Base.push!(scene::Scene, plot::AbstractPlot)
# update!(scene)
end

function Base.delete!(screen::AbstractScreen, scene::Scene, plot::AbstractPlot)
@warn "Deleting plots not implemented for backend: $(typeof(screen))"
end

function Base.delete!(scene::Scene, plot::AbstractPlot)
len = length(scene.plots)
filter!(x-> x !== plot, scene.plots)
if length(scene.plots) == len
error("$(typeof(plot)) not in scene!")
end
for screen in scene.current_screens
delete!(screen, scene, plot)
end
end

function Base.push!(scene::Scene, child::Scene)
push!(scene.children, child)
disconnect!(child.camera)
Expand Down

0 comments on commit 7e3c3ea

Please sign in to comment.