Skip to content

Commit

Permalink
Merge pull request #40 from mattuntergassmair/render_nothing
Browse files Browse the repository at this point in the history
allow to render nothing
  • Loading branch information
mattuntergassmair committed Jan 14, 2020
2 parents 64095fb + afae6e0 commit 45c61b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/renderable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,6 @@ function add_renderable!(rendermodel::RenderModel, scene::Frame{E}) where {E<:En
end
return rendermodel
end

# render nothing by not doing anything
add_renderable!(rm::RenderModel, ::Nothing) = rm
3 changes: 0 additions & 3 deletions src/roadways.jl
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,4 @@ function add_renderable!(rendermodel::RenderModel, roadway::Roadway;
return rendermodel
end

# for case when there is no roadway
add_renderable!(rendermodel::RenderModel, roadway::Nothing) = rendermodel

Base.show(io::IO, ::MIME"image/png", roadway::Roadway) = show(io, MIME"image/png"(), render(roadway))

0 comments on commit 45c61b7

Please sign in to comment.