Skip to content

Commit

Permalink
Fix #80
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasp85 committed Oct 25, 2024
1 parent 1201eb0 commit 22828dd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/add-grob.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@
#'
gtable_add_grob <- function(x, grobs, t, l, b = t, r = l, z = Inf, clip = "on", name = x$name) {
check_gtable(x)
if (is.grob(grobs)) grobs <- list(grobs)
if (!is.list(grobs)) {
if (is.grob(grobs)) {
grobs <- list(grobs)
}
if (!is_list(grobs) || any(!vapply(grobs, is.grob, logical(1)))) {
stop_input_type(grobs, "a single grob or a list of grobs")
}
n_grobs <- length(grobs)
Expand Down

0 comments on commit 22828dd

Please sign in to comment.