Skip to content

Commit

Permalink
Get meshimage working with tuple npoints (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
asinghvi17 authored Jul 30, 2024
1 parent 70e8694 commit cd2200e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mesh_image.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function Makie.plot!(plot::MeshImage)
# A sentinel so we can see if `npoints` changed. If it did, we have to
# recreate the mesh, which is slightly time-consuming. If not, though,
# then we only have to change the texture (image) which is cheaper.
old_npoints = Ref(0)
old_npoints = Ref{Any}(0)

# Handle the transformation
onany(plot, plot.converted[1], plot.converted[2], plot.transformation.transform_func, plot.npoints, plot.space, plot.z_level; update=true) do x_in, y_in, tfunc, npoints, space, z_level
Expand All @@ -79,7 +79,7 @@ function Makie.plot!(plot::MeshImage)
ys = LinRange(extrema(y_in)..., last(npoints))
poval = points_observable.val
# The array is in a grid, so we have to update them on a grid as well.
for (linear_ind, cartesian_ind) in enumerate(CartesianIndices((npoints, npoints)))
for (linear_ind, cartesian_ind) in enumerate(CartesianIndices((first(npoints), last(npoints))))
p = Point3d(xs[cartesian_ind[1]], ys[cartesian_ind[2]], z_level)
poval[linear_ind] = Makie.to_ndim(
Point3d,
Expand Down

0 comments on commit cd2200e

Please sign in to comment.