diff --git a/R/tmapGridAux.R b/R/tmapGridAux.R index f85682e8..47f9634f 100644 --- a/R/tmapGridAux.R +++ b/R/tmapGridAux.R @@ -88,10 +88,10 @@ tmapGridTilesPrep = function(a, bs, id, o) { d = s$dt d[, c("col", "legnr", "crtnr") := do.call(srgb$FUN, list(x1 = red, x2 = green, x3 = blue, scale = srgb, legend = list(), o = o, aes = "col", layer = "raster", sortRev = NA, bypass_ord = TRUE))] if ("alpha" %in% names(d)) { - d[, col_alpha:=alpha/255] + d[, col_alpha:=alpha/255 * a$alpha] d[is.na(col_alpha), col_alpha:=0] } else { - d[, col_alpha:=1L] + d[, col_alpha:=a$alpha] } d })