diff --git a/Project.toml b/Project.toml index 3fca9d6..4297266 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MakieTeX" uuid = "6d554a22-29e7-47bd-aee5-0c5f06619414" authors = ["Anshul Singhvi"] -version = "0.3" +version = "0.3.1" [deps] Cairo = "159f3aea-2a34-519c-b102-8c37f9878175" diff --git a/README.md b/README.md index af1a603..583f4ab 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ It works by compiling a stand-alone ->] (0, -2pt) arc (-180:0:8pt);}"; tellwidth = false, tellheight = true ) diff --git a/src/MakieTeX.jl b/src/MakieTeX.jl index 943f246..0da3ab4 100644 --- a/src/MakieTeX.jl +++ b/src/MakieTeX.jl @@ -1,8 +1,11 @@ module MakieTeX -using Makie, CairoMakie, Makie.MakieLayout +using Makie, CairoMakie using Cairo using Colors, LaTeXStrings +# patch for Makie.jl block macro error +using Makie: CURRENT_DEFAULT_THEME + using Makie.GeometryBasics: origin, widths using Makie.Observables using DocStringExtensions diff --git a/src/recipe.jl b/src/recipe.jl index ebecade..0bc26ca 100644 --- a/src/recipe.jl +++ b/src/recipe.jl @@ -19,7 +19,7 @@ end function Makie.boundingbox(x::T) where T <: TeXImg Makie.boundingbox( - x[1][], + x[1][] isa CachedTeX ? [x[1][]] : x[1][], to_ndim.(Point3f, x.position[], 0), x.rotations[], x.scale[], @@ -27,6 +27,10 @@ function Makie.boundingbox(x::T) where T <: TeXImg ) end +function Makie.data_limits(x::T) where T <: TeXImg + Makie.boundingbox(x) +end + function offset_from_align(align::Tuple{Symbol, Symbol}, wh)::Vec2f (halign::Symbol, valign::Symbol) = align @@ -59,7 +63,7 @@ function Makie.plot!(plot::T) where T <: TeXImg # We always want to draw this at a 1:1 ratio, so increasing scale or # changing dpi should rerender plottable_images = lift(plot[1], plot.render_density, plot.scale) do cachedtex, render_density, scale - to_array(firstpage2img.(cachedtex; render_density = render_density * scale)) + to_array(firstpage2img((cachedtex); render_density = render_density * scale)) end scatter_images = Observable(plottable_images[])