Skip to content

Commit 675b405

Browse files
authored
make sure linetype and linewidth is passed on to the polygongrob (#4001)
1 parent 7e5ff92 commit 675b405

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

R/geom-ribbon.r

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,19 @@ GeomRibbon <- ggproto("GeomRibbon", Geom,
138138

139139
munched <- coord_munch(coord, positions, panel_params)
140140

141+
is_full_outline <- identical(outline.type, "full")
141142
g_poly <- polygonGrob(
142143
munched$x, munched$y, id = munched$id,
143144
default.units = "native",
144145
gp = gpar(
145146
fill = alpha(aes$fill, aes$alpha),
146-
col = if (identical(outline.type, "full")) aes$colour else NA
147+
col = if (is_full_outline) aes$colour else NA,
148+
lwd = if (is_full_outline) aes$size * .pt else 0,
149+
lty = if (is_full_outline) aes$linetype else 1
147150
)
148151
)
149152

150-
if (identical(outline.type, "full")) {
153+
if (is_full_outline) {
151154
return(ggname("geom_ribbon", g_poly))
152155
}
153156

tests/figs/geom-smooth/ribbon-turned-on-in-geom-smooth.svg

Lines changed: 2 additions & 2 deletions
Loading

tests/figs/position-stack/area-stacking.svg

Lines changed: 2 additions & 2 deletions
Loading

0 commit comments

Comments
 (0)