Skip to content

Commit 8406115

Browse files
paleolimbotclauswilke
authored andcommitted
Dynamically assign pathGrob in .onLoad() to prevent packages that subclass GeomPolygon from throwing an install warning. Fixes #3312. (#3331)
1 parent 291cd7e commit 8406115

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

R/zzz.r

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,21 @@
1616
})
1717
}
1818

19+
# Assigning pathGrob in .onLoad ensures that packages that subclass GeomPolygon
20+
# do not install with error `possible error in 'pathGrob(munched$x, munched$y, ':
21+
# unused argument (pathId = munched$group)` despite the fact that this is correct
22+
# usage
23+
pathGrob <- NULL
24+
1925
.onLoad <- function(...) {
2026
backport_unit_methods()
2127

28+
if (getRversion() < as.numeric_version("3.6")) {
29+
pathGrob <<- function(..., pathId.lengths) {
30+
grid::pathGrob(...)
31+
}
32+
}
33+
2234
.zeroGrob <<- grob(cl = "zeroGrob", name = "NULL")
2335

2436
ggplot_global$theme_current <- theme_gray()

0 commit comments

Comments
 (0)