Skip to content

Commit

Permalink
Let the layoutable consume arbitrary document types
Browse files Browse the repository at this point in the history
  • Loading branch information
asinghvi17 committed Jun 5, 2024
1 parent 17b6fab commit 79bd210
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/layoutable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,17 @@ end

LTeX(x, tex; kwargs...) = LTeX(x; tex = tex, kwargs...)

_to_cachedtex(x) = CachedTeX(x)
_to_cachedtex(x::AbstractDocument) = Cached(x)

function Makie.initialize_block!(l::LTeX)

topscene = l.blockscene
layoutobservables = l.layoutobservables

textpos = Observable(Point3f[(0, 0, 0)])

cached_tex = lift(collect tuple CachedTeX, l.tex)
cached_tex = lift(collect tuple _to_cachedtex, l.tex)

t = teximg!(
topscene, cached_tex; position = textpos, visible = l.visible,
Expand Down

0 comments on commit 79bd210

Please sign in to comment.