Skip to content

Commit

Permalink
Merge pull request #142 from haakon-e/up_compat
Browse files Browse the repository at this point in the history
Up compat to support Makie 0.19 and associated fixes
  • Loading branch information
SimonDanisch authored Dec 6, 2022
2 parents d9404ac + 3d8e7eb commit e8921ce
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion examples/axis_config.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion examples/old/meshgrid2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/geoaxis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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),
# )
Expand All @@ -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),
# )
Expand Down
9 changes: 5 additions & 4 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@ 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, fonts, align, rotation, justification, lineheight)
glyph_collection = Makie.layout_text(
textstring, textsize,
font, align, rotation, justification, lineheight,
textstring, fontsize,
string(font), fonts, align, rotation, justification, lineheight,
RGBAf(0,0,0,0), RGBAf(0,0,0,0), 0f0, 0f0
)

Expand Down Expand Up @@ -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))
)
Expand Down

0 comments on commit e8921ce

Please sign in to comment.