Skip to content

Commit 039d38f

Browse files
committed
Use theme inheritance system in coord_sf
Since the graticules are drawn "by hand". Fixes #2389
1 parent 0eadf1b commit 039d38f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

R/sf.R

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,8 @@ CoordSf <- ggproto("CoordSf", CoordCartesian,
367367
},
368368

369369
render_bg = function(self, panel_params, theme) {
370-
line_gp <- gpar(
371-
col = theme$panel.grid.major$colour,
372-
lwd = theme$panel.grid.major$size,
373-
lty = theme$panel.grid.major$linetype
374-
)
370+
el <- calc_element("panel.grid.major", theme)
371+
line_gp <- gpar(col = el$colour, lwd = el$size, lty = el$linetype)
375372
grobs <- c(
376373
list(element_render(theme, "panel.background")),
377374
lapply(sf::st_geometry(panel_params$graticule), sf::st_as_grob, gp = line_gp)

0 commit comments

Comments
 (0)