Skip to content

Commit

Permalink
Close #82: Account for the fact that element_blank() elements are len…
Browse files Browse the repository at this point in the history
…gth 0, but should be considered defined
  • Loading branch information
cpsievert committed Feb 1, 2021
1 parent 45454fa commit 820d464
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/ggplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,10 @@ resolve_theme_inheritance <- function(p_theme) {
parent_el <- p_theme[[this_parent]]
kid_el <- p_theme[[this_kid]]
# parent doesn't exist so do nothing
if (!length(parent_el)) {
if (is.null(parent_el)) {
next
}
p_theme[[this_kid]] <- if (length(kid_el)) {
p_theme[[this_kid]] <- if (!is.null(kid_el)) {
# both parent & child exist
ggplot2::merge_element(new = kid_el, old = parent_el)
} else {
Expand Down

0 comments on commit 820d464

Please sign in to comment.