From 26eadac28c523917be3468d8b1d322e7a94373ce Mon Sep 17 00:00:00 2001 From: lazarusA Date: Sat, 3 Dec 2022 19:58:29 +0100 Subject: [PATCH 1/2] up compat to support Makie 0.19 --- Project.toml | 2 +- examples/axis_config.jl | 2 +- examples/old/meshgrid2.jl | 2 +- src/geoaxis.jl | 4 ++-- src/utils.jl | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Project.toml b/Project.toml index 28d27730..13b49e53 100644 --- a/Project.toml +++ b/Project.toml @@ -24,7 +24,7 @@ GeoInterface = "0.5, 1.0" GeoJSON = "0.6" GeometryBasics = "0.4.4" ImageIO = "0.6" -Makie = "0.17.1, 0.18" +Makie = "0.17.1, 0.18, 0.19" Proj = "1.2.0" Reexport = "1" StructArrays = "0.4, 0.5, 0.6" diff --git a/examples/axis_config.jl b/examples/axis_config.jl index 4f3c3426..550c1b61 100644 --- a/examples/axis_config.jl +++ b/examples/axis_config.jl @@ -15,7 +15,7 @@ axs[1, 2].spinewidth = 5 # axis 3 - messing with grids axs[2, 1].xgridcolor = :blue -axs[2, 1].xgridstyle = :dashdot +#axs[2, 1].xgridstyle = :dashdot # bug ! not working now, open independent issue for it axs[2, 1].ygridcolor = (:orange, 0.5) axs[2, 1].ygridwidth = 2.0 diff --git a/examples/old/meshgrid2.jl b/examples/old/meshgrid2.jl index 1f4c34de..1611e5a9 100644 --- a/examples/old/meshgrid2.jl +++ b/examples/old/meshgrid2.jl @@ -42,7 +42,7 @@ translate!(rect, Vec3f(0, 0, 100)) textnode = Observable(" ") -text!(popup, textnode, textsize = 30, position = textpos, color = :darkred, align = (:center, :center), raw = true, visible = visible) +text!(popup, textnode, fontsize = 30, position = textpos, color = :darkred, align = (:center, :center), raw = true, visible = visible) on(scene.events.mouseposition) do pos if ispressed(scene, Mouse.left) diff --git a/src/geoaxis.jl b/src/geoaxis.jl index 7f0821ef..642f42d1 100644 --- a/src/geoaxis.jl +++ b/src/geoaxis.jl @@ -413,7 +413,7 @@ function draw_geoticks!(ax::Axis, hijacked_observables, line_density, remove_ove # position = xtickpoints, # rotation = ax.xticklabelrotation, # font = ax.xticklabelfont, - # textsize = ax.xticklabelsize, + # fontsize = ax.xticklabelsize, # color = ax.xticklabelcolor, # align = (:center, :center), # ) @@ -426,7 +426,7 @@ function draw_geoticks!(ax::Axis, hijacked_observables, line_density, remove_ove # position = ytickpoints, # rotation = ax.yticklabelrotation, # font = ax.yticklabelfont, - # textsize = ax.yticklabelsize, + # fontsize = ax.yticklabelsize, # color = ax.yticklabelcolor, # align = (:center, :center), # ) diff --git a/src/utils.jl b/src/utils.jl index 8cfbed3b..27768155 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -228,9 +228,9 @@ function project_to_pixelspace(scene, points::AbstractVector{Point{N, T}}) where ) end -function text_bbox(textstring::AbstractString, textsize::Union{AbstractVector, Number}, font, align, rotation, justification, lineheight) +function text_bbox(textstring::AbstractString, fontsize::Union{AbstractVector, Number}, font, align, rotation, justification, lineheight) glyph_collection = Makie.layout_text( - textstring, textsize, + textstring, fontsize, font, align, rotation, justification, lineheight, RGBAf(0,0,0,0), RGBAf(0,0,0,0), 0f0, 0f0 ) From 3d8e7ebb9c1ba4bf2df764f7f8a7d47ad47ca65b Mon Sep 17 00:00:00 2001 From: Haakon Ludvig Langeland Ervik <45243236+haakon-e@users.noreply.github.com> Date: Mon, 5 Dec 2022 15:52:13 -0800 Subject: [PATCH 2/2] fix compat for Makie --- src/utils.jl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils.jl b/src/utils.jl index 27768155..4a192ce9 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -228,10 +228,10 @@ function project_to_pixelspace(scene, points::AbstractVector{Point{N, T}}) where ) end -function text_bbox(textstring::AbstractString, fontsize::Union{AbstractVector, Number}, font, align, rotation, justification, lineheight) +function text_bbox(textstring::AbstractString, fontsize::Union{AbstractVector, Number}, font, fonts, align, rotation, justification, lineheight) glyph_collection = Makie.layout_text( textstring, fontsize, - font, align, rotation, justification, lineheight, + string(font), fonts, align, rotation, justification, lineheight, RGBAf(0,0,0,0), RGBAf(0,0,0,0), 0f0, 0f0 ) @@ -279,9 +279,10 @@ function directional_pad(scene, limits, tickcoord_in_inputspace, ticklabel::Abst normal_vec = Vec2f((dx, dy)./sqrt(dx^2 + dy^2)) # We have computed the normal vector - now we have to get tick extents + fonts = theme(scene, :fonts) extents = text_bbox( ticklabel, ticksize, - tickfont, Vec2f(0), tickrotation, + tickfont, fonts, Vec2f(0), tickrotation, 0.0, # Makie.to_value(Makie.theme(scene, :justification)), 0.0, # Makie.to_value(Makie.theme(scene, :lineheight)) )