Skip to content

Commit c708f76

Browse files
committed
improve previous commit
1 parent c889fa2 commit c708f76

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

R/ggplotly.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,8 @@ unitConvert <- function(u, to = c("npc", "pixels"), type = c("x", "y", "height",
11381138
mm2pixels <- function(u) {
11391139
u <- verifyUnit(u)
11401140
if (getRversion() >= "4.0.0") {
1141-
if (grid::unitType(u) != "mm") {
1141+
unitType <- get("unitType", envir=asNamespace("grid"))
1142+
if (unitType(u) != "mm") {
11421143
stop("Unit must be in millimeters")
11431144
}
11441145
} else {

0 commit comments

Comments
 (0)