Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions R/guides-.R
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ Guides <- ggproto(
if (length(default_position) == 2) {
default_position <- "inside"
}
if (default_position == "none") {
if (!default_position %in% c(.trbl, "inside")) {
return(zeroGrob())
}

Expand Down Expand Up @@ -546,7 +546,8 @@ Guides <- ggproto(
legend.justification.inside = groups$key$justs[[i]]
)
}
grobs[[i]] <- self$package_box(grobs[[i]], position, theme + adjust)
adjust <- add_theme(theme, adjust, "internal theme settings")
grobs[[i]] <- self$package_box(grobs[[i]], position, adjust)
}

# merge inside grobs into single gtable
Expand Down Expand Up @@ -597,11 +598,7 @@ Guides <- ggproto(
}

# Determine default direction
direction <- switch(
position,
inside = , left = , right = "vertical",
top = , bottom = "horizontal"
)
direction <- switch(position, top = , bottom = "horizontal", "vertical")

# Populate missing theme arguments
theme$legend.box <- theme$legend.box %||% direction
Expand Down
Loading