Skip to content

Commit

Permalink
draw_key_draw: fix error for gList output
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunuuuu committed Nov 15, 2024
1 parent 1d829dd commit 13826bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
14 changes: 7 additions & 7 deletions R/geom-draw.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,16 @@
#' pointsGrob(x, y, pch = shape),
#' # To ensure the rectangle color is shown in the legends, you
#' # must explicitly provide a color argument and include it in
# ' # the `gpar()` of the graphical object
#' # the `gpar()` of the graphical object
#' rectGrob(x, y, width, height,
#' gp = gpar(col = "black", fill = NA)
#' )
#' )
#' },
#' e = function(xmin, xmax, ymin, ymax) {
#' segmentsGrob(
#' xmin,
#' ymin,
#' xmax,
#' ymax,
#' xmin, ymin,
#' xmax, ymax,
#' gp = gpar(lwd = 2)
#' )
#' }
Expand Down Expand Up @@ -115,10 +113,12 @@ draw_key_draw <- function(data, params, size) {
}
}
if (any(args == "...")) {
inject(draw(!!!data))
ans <- inject(draw(!!!data))
} else {
inject(draw(!!!.subset(data, args)))
ans <- inject(draw(!!!.subset(data, args)))
}
if (inherits(ans, "gList")) ans <- grid::gTree(children = ans)
ans
}

combine_aes <- function(...) {
Expand Down
7 changes: 3 additions & 4 deletions man/geom_draw.Rd

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

7 changes: 3 additions & 4 deletions man/scale_draw_manual.Rd

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

0 comments on commit 13826bb

Please sign in to comment.