From 9b4d4fe624fc2dd1a510bada0cc52af3ab31c847 Mon Sep 17 00:00:00 2001 From: Teun van den Brand <49372158+teunbrand@users.noreply.github.com> Date: Tue, 27 Feb 2024 18:09:30 +0100 Subject: [PATCH] Patterns in `geom_sf()` (#5717) * Use `fill_alpha()` instead of `alpha()` * add news bullet --- NEWS.md | 2 ++ R/geom-sf.R | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index c68d560725..1715a4c82f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,6 +6,8 @@ * Facet evaluation is better at dealing with inherited errors (@teunbrand, #5670). * Fixed spurious warnings from `sec_axis()` with `breaks = NULL` (#5713). +* Patterns and gradients are now also enabled in `geom_sf()` + (@teunbrand, #5716). # ggplot2 3.5.0 diff --git a/R/geom-sf.R b/R/geom-sf.R index 882da40a64..a4dd6ff344 100644 --- a/R/geom-sf.R +++ b/R/geom-sf.R @@ -202,7 +202,7 @@ sf_grob <- function(x, lineend = "butt", linejoin = "round", linemitre = 10, col <- x$colour %||% defaults$colour[type_ind] col[is_point | is_line] <- alpha(col[is_point | is_line], alpha[is_point | is_line]) fill <- x$fill %||% defaults$fill[type_ind] - fill <- alpha(fill, alpha) + fill <- fill_alpha(fill, alpha) size <- x$size %||% defaults$size[type_ind] linewidth <- x$linewidth %||% defaults$linewidth[type_ind] point_size <- ifelse(