diff --git a/R/geom-label-repel.R b/R/geom-label-repel.R index 4b5acc4..a5cc36d 100644 --- a/R/geom-label-repel.R +++ b/R/geom-label-repel.R @@ -231,8 +231,9 @@ makeContent.labelrepeltree <- function(x) { point.size <- point.size * .pt / .stroke / 20 # The padding around each point. - point.padding <- length_cm(x$point.padding) - point.padding[is.na(point.padding)] <- 0 + point.padding <- x$point.padding + if (is.na(point.padding)) point.padding <- to_unit(0) + point.padding <- length_cm(point.padding) min.segment.length <- length_cm(x$min.segment.length) diff --git a/R/geom-text-repel.R b/R/geom-text-repel.R index 504aeb4..e8e36bd 100644 --- a/R/geom-text-repel.R +++ b/R/geom-text-repel.R @@ -376,8 +376,9 @@ makeContent.textrepeltree <- function(x) { point.size <- point.size * .pt / .stroke / 20 # The padding around each point. - point.padding <- length_cm(x$point.padding) - point.padding[is.na(point.padding)] <- 0 + point.padding <- x$point.padding + if (is.na(point.padding)) point.padding <- to_unit(0) + point.padding <- length_cm(point.padding) min.segment.length <- length_cm(x$min.segment.length)