From 52135ca56ec42263dbc3e665c90f7315b08636b0 Mon Sep 17 00:00:00 2001 From: rCarto Date: Mon, 4 Mar 2024 10:28:02 +0100 Subject: [PATCH] fix: allow to plot non overlapping labels from a layer made of strictly overlapping features fix #65 --- R/mf_labels_utils.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/mf_labels_utils.R b/R/mf_labels_utils.R index 069e4b5..35585e3 100644 --- a/R/mf_labels_utils.R +++ b/R/mf_labels_utils.R @@ -16,8 +16,8 @@ wordlayout <- function(x, y, words, cex = 1, q) { n <- length(words) sdx <- sd(x, na.rm = TRUE) sdy <- sd(y, na.rm = TRUE) - if (sdx == 0) sdx - if (sdy == 0) sdy + if (sdx == 0) sdx <- 1 + if (sdy == 0) sdy <- 1 if (length(cex) == 1) cex <- rep(cex, n) boxes <- list() for (i in seq_along(words)) {