From 762bb62d41459c7918111279cadf0cdc436372c2 Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Wed, 25 Dec 2024 12:45:44 +0530 Subject: [PATCH] Handle both versions of GB in meshimage recipe --- src/mesh_image.jl | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/mesh_image.jl b/src/mesh_image.jl index 496ad99a..37c273e6 100644 --- a/src/mesh_image.jl +++ b/src/mesh_image.jl @@ -113,11 +113,18 @@ function Makie.plot!(plot::MeshImage) # You may have noticed that nowhere above did we actually create a mesh. # Let's remedy that now! final_mesh = lift(plot, points_observable, faces_observable, uv_observable; ignore_equal_values = true#=, priority = -100=#) do points, faces, uv - return GeometryBasics.Mesh( - points, - faces; - uv = uv, # each point gets a UV, they're interpolated on faces - ) + @static if hasproperty(GeometryBasics, :metafree) # pre v0.5 + return GeometryBasics.Mesh( + GeometryBasics.meta(points; uv=uv), # each point gets a UV, they're interpolated on faces + faces + ) + else # post v0.5 / Makie v0.22 + return GeometryBasics.Mesh( + points, + faces; + uv = uv, # each point gets a UV, they're interpolated on faces + ) + end end # Finally, we plot the mesh.