From 840a8ec0250961bfd2668fcadcb71d3e81759bc7 Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Thu, 10 Oct 2024 08:05:02 +0200 Subject: [PATCH 1/2] pass linetype --- R/geom-sf.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/geom-sf.R b/R/geom-sf.R index 2e9aee78b8..dfc3926153 100644 --- a/R/geom-sf.R +++ b/R/geom-sf.R @@ -238,7 +238,8 @@ GeomSf <- ggproto("GeomSf", Geom, linewidth[is_point] <- stroke[is_point] gp <- gpar( - col = colour, fill = fill, fontsize = font_size, lwd = linewidth, + col = colour, fill = fill, fontsize = font_size, + lwd = linewidth, lty = data$linetype, lineend = lineend, linejoin = linejoin, linemitre = linemitre ) From 5047cc0388b21c7c1e68d3c338d3b4d40cf22c53 Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Thu, 10 Oct 2024 08:07:59 +0200 Subject: [PATCH 2/2] include linetype in one of the visual tests --- .../_snaps/geom-sf/north-carolina-county-boundaries.svg | 2 +- tests/testthat/test-geom-sf.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testthat/_snaps/geom-sf/north-carolina-county-boundaries.svg b/tests/testthat/_snaps/geom-sf/north-carolina-county-boundaries.svg index 40e2e8c503..ebb2ccaf03 100644 --- a/tests/testthat/_snaps/geom-sf/north-carolina-county-boundaries.svg +++ b/tests/testthat/_snaps/geom-sf/north-carolina-county-boundaries.svg @@ -36,7 +36,7 @@ - + diff --git a/tests/testthat/test-geom-sf.R b/tests/testthat/test-geom-sf.R index e52a13e917..cb73bf846b 100644 --- a/tests/testthat/test-geom-sf.R +++ b/tests/testthat/test-geom-sf.R @@ -180,7 +180,7 @@ test_that("geom_sf draws correctly", { expect_error(regexp = NA, ggplot_build(plot)) expect_doppelganger("North Carolina county boundaries", - ggplot() + geom_sf(data = nc) + coord_sf(datum = 4326) + ggplot() + geom_sf(data = nc, linetype = 2) + coord_sf(datum = 4326) ) pts <- sf::st_sf(a = 1:2, geometry = sf::st_sfc(sf::st_point(0:1), sf::st_point(1:2)))