Skip to content

Commit

Permalink
guard against NA point padding
Browse files Browse the repository at this point in the history
  • Loading branch information
teunbrand committed Jan 24, 2024
1 parent 16e3493 commit 52885b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions R/geom-label-repel.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
5 changes: 3 additions & 2 deletions R/geom-text-repel.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 52885b5

Please sign in to comment.