Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mtennekes committed Aug 24, 2024
1 parent 72f9a58 commit 8823764
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/tmapGridLegend.R
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ tmapGridLegend = function(comp, o, facet_row = NULL, facet_col = NULL, facet_pag
# in case breaks are defined: compute width

# for fitting breaks (half of last 'breaks' word + width of units text)
Wextra = (ceiling(nchar(tail(cmp$breaks, 1)) / 2) + 2 + nchar(cmp$units$unit)) * cmp$Wextra_line # for fitting break labels
Wextra = (ceiling(nchar(tail(cmp$breaks, 1)) / 2) + nchar(cmp$units$unit)/2) * cmp$Wextra_line # for fitting break labels (in theory, it should include a " ", and a bit for the left-hand side, but in practice this is a better fit)

# bbw are number of (CRS) units of map width, totalCoords translated to scalebar units
totalCoords = bbw * cmp$units$to
Expand Down

0 comments on commit 8823764

Please sign in to comment.