Skip to content

Commit

Permalink
even if the dev is not pdf, still try to pass dev.args to the device,…
Browse files Browse the repository at this point in the history
… e.g. pointsize is a shared argument of pdf() and png()

this fixes http://stackoverflow.com/q/21613467/559676 reported by @kbroman
  • Loading branch information
yihui committed Feb 7, 2014
1 parent b4f74b4 commit e430c60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/block.R
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ purge_cache = function(options) {
# not need to close the device on exit
chunk_device = function(width, height, record = TRUE, dev, dev.args) {
dev_new = function() {
if (identical(getOption('device'), pdf_null) && ('pdf' %in% dev)) {
if (identical(getOption('device'), pdf_null)) {
if (!is.null(dev.args)) {
dev.args = get_dargs(dev.args, dev, 'pdf')
dev.args = dev.args[intersect(names(dev.args), names(formals(pdf)))]
Expand Down

0 comments on commit e430c60

Please sign in to comment.