Skip to content

Commit c4882c6

Browse files
committed
fix inside legend coordinates
1 parent d1f6833 commit c4882c6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

R/guides-.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,10 @@ Guides <- ggproto(
618618
global_xjust <- inside_just[1]
619619
global_yjust <- inside_just[2]
620620
global_margin <- margin()
621-
if (is.null(inside_position)) { # for backward compatibility
621+
# # for backward compatibility, no `inside_position` input
622+
if (is.null(inside_position) ||
623+
# `inside_position` is a list of length one
624+
is.null(inside_position <- inside_position[[1L]])) {
622625
x <- global_xjust
623626
y <- global_yjust
624627
} else {
@@ -707,7 +710,7 @@ Guides <- ggproto(
707710

708711
# Set global justification
709712
vp <- viewport(
710-
x = global_xjust, y = global_yjust, just = global_just,
713+
x = x, y = y, just = global_just,
711714
height = vp_height,
712715
width = max(widths)
713716
)

0 commit comments

Comments
 (0)