@@ -480,7 +480,7 @@ Guides <- ggproto(
480
480
if (length(default_position ) == 2 ) {
481
481
default_position <- " inside"
482
482
}
483
- if (default_position == " none " ) {
483
+ if (! default_position %in% c( .trbl , " inside " ) ) {
484
484
return (zeroGrob())
485
485
}
486
486
@@ -547,7 +547,8 @@ Guides <- ggproto(
547
547
legend.justification.inside = groups $ key $ justs [[i ]]
548
548
)
549
549
}
550
- grobs [[i ]] <- self $ package_box(grobs [[i ]], position , theme + adjust )
550
+ adjust <- add_theme(theme , adjust , " internal theme settings" )
551
+ grobs [[i ]] <- self $ package_box(grobs [[i ]], position , adjust )
551
552
}
552
553
553
554
# merge inside grobs into single gtable
@@ -598,11 +599,7 @@ Guides <- ggproto(
598
599
}
599
600
600
601
# Determine default direction
601
- direction <- switch (
602
- position ,
603
- inside = , left = , right = " vertical" ,
604
- top = , bottom = " horizontal"
605
- )
602
+ direction <- switch (position , top = , bottom = " horizontal" , " vertical" )
606
603
607
604
# Populate missing theme arguments
608
605
theme $ legend.box <- theme $ legend.box %|| % direction
0 commit comments