Skip to content

Commit f2c85b1

Browse files
committed
default to bg='white', not transparent
1 parent 5157c76 commit f2c85b1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

R/render-plot.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ resizeSavedPlot <- function(name, session, result, width, height, pixelratio, re
258258
# reflected in the recordedPlot?
259259
grDevices::replayPlot(result$recordedPlot)
260260
coordmap <<- getCoordmap(result$plotResult, width*pixelratio, height*pixelratio, res*pixelratio)
261-
}, width = width*pixelratio, height = height*pixelratio, res = res*pixelratio, bg = theme$bg %OR% "transparent", ...)
261+
# TODO: if and when we move to ragg::agg_png(), we'll need to translate bg -> background
262+
}, width = width*pixelratio, height = height*pixelratio, res = res*pixelratio, bg = theme$bg %OR% "white", ...)
262263
on.exit(unlink(outfile), add = TRUE)
263264

264265
result$img <- list(
@@ -287,8 +288,9 @@ drawPlot <- function(name, session, func, width, height, pixelratio, res, theme
287288
# 10. On error, take width and height dependency
288289

289290
outfile <- tempfile(fileext='.png') # If startPNG throws, this could leak. Shrug.
291+
# TODO: if and when we move to ragg::agg_png(), we'll need to translate bg -> background
290292
device <- startPNG(outfile, width*pixelratio, height*pixelratio, res = res*pixelratio,
291-
bg = theme$bg %OR% "transparent", ...)
293+
bg = theme$bg %OR% "white", ...)
292294
domain <- createGraphicsDevicePromiseDomain(device)
293295
grDevices::dev.control(displaylist = "enable")
294296

0 commit comments

Comments
 (0)