Skip to content

Commit a2bad41

Browse files
committed
follow conventional inheritance to satisfy test
1 parent f47465c commit a2bad41

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

R/theme-defaults.R

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,10 @@ theme_void <- function(base_size = 11, base_family = "",
559559
# Only keep indispensable text: legend and plot titles
560560
t <- theme(
561561
line = element_blank(),
562-
rect = element_blank(),
562+
rect = element_rect(
563+
fill = paper, colour = NA, linewidth = 0, linetype = 1,
564+
inherit.blank = FALSE
565+
),
563566
polygon = element_blank(),
564567
point = element_blank(),
565568
text = element_text(
@@ -591,12 +594,18 @@ theme_void <- function(base_size = 11, base_family = "",
591594
legend.box.margin = rel(0),
592595
legend.box.spacing = unit(0.2, "cm"),
593596
legend.ticks.length = rel(0.2),
597+
legend.background = element_blank(),
598+
legend.frame = element_blank(),
599+
legend.box.background = element_blank(),
594600
strip.clip = "on",
595601
strip.text = element_text(size = rel(0.8)),
596602
strip.switch.pad.grid = rel(0.5),
597603
strip.switch.pad.wrap = rel(0.5),
604+
strip.background = element_blank(),
598605
panel.ontop = FALSE,
599606
panel.spacing = NULL,
607+
panel.background = element_blank(),
608+
panel.border = element_blank(),
600609
plot.margin = rel(0),
601610
plot.title = element_text(
602611
size = rel(1.2),
@@ -619,15 +628,9 @@ theme_void <- function(base_size = 11, base_family = "",
619628
hjust = 0.5, vjust = 0.5
620629
),
621630
plot.tag.position = 'topleft',
631+
plot.background = element_rect(),
622632

623633
complete = TRUE
624-
) + theme(
625-
# Contrary to default behaviour, we do not want to inherit the plot
626-
# background from a blank root element
627-
plot.background = element_rect(
628-
fill = paper, colour = NA, linewidth = 0, linetype = 1,
629-
inherit.blank = FALSE
630-
)
631634
)
632635

633636
# make sure all elements are set to NULL if not explicitly defined

0 commit comments

Comments
 (0)