Skip to content

Commit

Permalink
fix color hanbdling, tweak render order in GLMakie
Browse files Browse the repository at this point in the history
  • Loading branch information
ffreyer committed Aug 7, 2023
1 parent 23b0470 commit 8da99ef
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/basic_recipes/voronoiplot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,14 @@ function plot!(p::Voronoiplot{<:Tuple{<:DelTri.VoronoiTessellation}})
# generate some consistent distinguishable colors
cs = [sum(DelTri.get_generator(vorn, i)) for i in DelTri.each_generator(vorn)]
reverse!(cs)
else
elseif color isa AbstractArray
@assert(
length(color) == DelTri.num_points(DelTri.get_triangulation(vorn)),
"Color vector must have the same length as the number of generators, including any not yet in the tessellation."
)
[color[i] for i in DelTri.each_generator(vorn)] # this matches the polygon order
else
color
end
end

Expand Down Expand Up @@ -185,7 +187,8 @@ function plot!(p::Voronoiplot{<:Tuple{<:DelTri.VoronoiTessellation}})
markersize=p.markersize,
marker=p.marker,
color=p.markercolor,
visible=p.show_generators)
visible=p.show_generators,
depth_shift=-2f-5)

return p
end

0 comments on commit 8da99ef

Please sign in to comment.