Skip to content

Commit

Permalink
add that to GlobeAxis too
Browse files Browse the repository at this point in the history
  • Loading branch information
asinghvi17 committed Dec 3, 2024
1 parent dcd030a commit 3a6afc2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sphere/globeaxis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,16 @@ tightlimits!(::GlobeAxis) = nothing # TODO implement!? By getting the bbox of t

# This is where we override the stuff to make it our stuff.
function Makie.plot!(axis::GlobeAxis, plot::Makie.AbstractPlot)
# deal with setting the transform_func correctly
source = pop!(plot.kw, :source, axis.source)
zlevel = pop!(plot.kw, :zlevel, 0)
# @show plot.kw
transformfunc = lift(create_globe_transform, axis.ellipsoid, source, zlevel)
trans = Makie.Transformation(transformfunc; get(plot.kw, :transformation, Attributes())...)
plot.kw[:transformation] = trans

reset_limits = to_value(pop!(plot.kw, :reset_limits, true))

Makie.plot!(axis.scene, plot)

# reassign popped observables back to attributes, so that they can be called by the user...
Expand All @@ -348,7 +351,7 @@ function Makie.plot!(axis::GlobeAxis, plot::Makie.AbstractPlot)
# adjust the limit margins in those cases automatically.
# However, for spheres, we want to keep user zoom level if possible.
# Makie.needs_tight_limits(plot) && Makie.tightlimits!(axis)
if Makie.is_open_or_any_parent(axis.scene)
if Makie.is_open_or_any_parent(axis.scene) && reset_limits
Makie.reset_limits!(axis)
end
return plot
Expand Down

0 comments on commit 3a6afc2

Please sign in to comment.