Skip to content

Commit

Permalink
fixed #909
Browse files Browse the repository at this point in the history
  • Loading branch information
mtennekes committed Jul 29, 2024
1 parent feae681 commit fab7335
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/tmapGridLegend.R
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,13 @@ tmapGridCompCorner = function(comp, o, stack, pos.h, pos.v, maxH, maxW, offsetIn
comp = lapply(comp, process_comp_box, sc = sc, o = o)

groupframe = if ((comp[[1]]$frame.lwd!=0) && group.frame) {
gridCell(range(Hid), range(Wid), rndrectGrob(gp=grid::gpar(fill = comp[[1]]$bg.color, col = comp[[1]]$frame, lwd = comp[[1]]$frame.lwd), r = comp[[1]]$frame.r))
gridCell(range(Hid), range(Wid), rndrectGrob(gp=grid::gpar(fill = comp[[1]]$bg.color, alpha = comp[[1]]$bg.alpha, col = comp[[1]]$frame, lwd = comp[[1]]$frame.lwd), r = comp[[1]]$frame.r))
} else NULL


grbs = do.call(grid::gList, mapply(function(leg, lG, lH, lW, iW, iH) {
frame = if (!is.na(leg$frame) && !group.frame) {
rndrectGrob(gp=grid::gpar(fill = leg$bg.color, col = leg$frame, lwd = leg$frame.lwd), r = leg$frame.r)
rndrectGrob(gp=grid::gpar(fill = leg$bg.color, alpha = leg$bg.alpha, col = leg$frame, lwd = leg$frame.lwd), r = leg$frame.r)
} else NULL
if (stack == "vertical") {
x = switch(leg$position$align.h, "left" = lW/2, "right" = grid::unit(W, "inch") -lW/2, grid::unit(0.5, "npc"))
Expand Down

0 comments on commit fab7335

Please sign in to comment.