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
)
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)))