Skip to content

Commit

Permalink
patch.trellis: use grid.grabExpr instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunuuuu committed Sep 13, 2024
1 parent 4ddf211 commit a47a9fc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
6 changes: 2 additions & 4 deletions R/alignpatch-wrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,12 @@ offscreen <- function(width, height) {
}

#' @inherit patch.grob
#' @inheritDotParams grid::grid.grabExpr -expr -device
#' @inheritParams grid::grid.grabExpr
#' @seealso [trellis][lattice::trellis.object]
#' @export
patch.trellis <- function(x, ..., device = NULL) {
grid::recordGrob(
print(plot, newpage = FALSE),
list(plot = plot, device = device %||% offscreen)
)
grid::grid.grabExpr(expr = print(x), ..., device = device %||% offscreen)
}

#' @inherit patch.grob
Expand Down
22 changes: 21 additions & 1 deletion man/patch.trellis.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a47a9fc

Please sign in to comment.