Skip to content

Commit

Permalink
improve previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pmur002 committed Oct 23, 2019
1 parent c889fa2 commit c708f76
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/ggplotly.R
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,8 @@ unitConvert <- function(u, to = c("npc", "pixels"), type = c("x", "y", "height",
mm2pixels <- function(u) {
u <- verifyUnit(u)
if (getRversion() >= "4.0.0") {
if (grid::unitType(u) != "mm") {
unitType <- get("unitType", envir=asNamespace("grid"))
if (unitType(u) != "mm") {
stop("Unit must be in millimeters")
}
} else {
Expand Down

0 comments on commit c708f76

Please sign in to comment.