Skip to content

Commit 8273111

Browse files
committed
apply to geom_sf_labels() too
1 parent 28b74be commit 8273111

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

R/geom-sf.R

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,11 @@ geom_sf_label <- function(mapping = aes(), data = NULL,
321321
nudge_y = 0,
322322
label.padding = unit(0.25, "lines"),
323323
label.r = unit(0.15, "lines"),
324-
label.size = 0.25,
324+
label.size = deprecated(),
325+
border.colour = NULL,
326+
border.color = NULL,
327+
text.colour = NULL,
328+
text.color = NULL,
325329
na.rm = FALSE,
326330
show.legend = NA,
327331
inherit.aes = TRUE,
@@ -338,6 +342,12 @@ geom_sf_label <- function(mapping = aes(), data = NULL,
338342
position <- position_nudge(nudge_x, nudge_y)
339343
}
340344

345+
extra_args <- list2(...)
346+
if (lifecycle::is_present(label.size)) {
347+
deprecate_warn0("3.5.0", "geom_label(label.size)", "geom_label(linewidth)")
348+
extra_args$linewidth <- extra_args$linewidth %||% label.size
349+
}
350+
341351
layer_sf(
342352
data = data,
343353
mapping = mapping,
@@ -350,10 +360,11 @@ geom_sf_label <- function(mapping = aes(), data = NULL,
350360
parse = parse,
351361
label.padding = label.padding,
352362
label.r = label.r,
353-
label.size = label.size,
354363
na.rm = na.rm,
355364
fun.geometry = fun.geometry,
356-
...
365+
border.colour = border.color %||% border.colour,
366+
text.colour = text.color %||% text.colour,
367+
!!!extra_args
357368
)
358369
)
359370
}

0 commit comments

Comments
 (0)