Skip to content

Commit bf75f30

Browse files
authored
Restore geom_sf()'s linetype aesthetic (#6132)
* pass linetype * include linetype in one of the visual tests
1 parent 3faa53a commit bf75f30

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

R/geom-sf.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ GeomSf <- ggproto("GeomSf", Geom,
238238
linewidth[is_point] <- stroke[is_point]
239239

240240
gp <- gpar(
241-
col = colour, fill = fill, fontsize = font_size, lwd = linewidth,
241+
col = colour, fill = fill, fontsize = font_size,
242+
lwd = linewidth, lty = data$linetype,
242243
lineend = lineend, linejoin = linejoin, linemitre = linemitre
243244
)
244245

tests/testthat/_snaps/geom-sf/north-carolina-county-boundaries.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/testthat/test-geom-sf.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ test_that("geom_sf draws correctly", {
177177
expect_no_error(ggplot_build(plot))
178178

179179
expect_doppelganger("North Carolina county boundaries",
180-
ggplot() + geom_sf(data = nc) + coord_sf(datum = 4326)
180+
ggplot() + geom_sf(data = nc, linetype = 2) + coord_sf(datum = 4326)
181181
)
182182

183183
pts <- sf::st_sf(a = 1:2, geometry = sf::st_sfc(sf::st_point(0:1), sf::st_point(1:2)))

0 commit comments

Comments
 (0)