Skip to content

Commit 6da6532

Browse files
committed
ensure scalar width/height when preserving aspect ratio
1 parent 3764c97 commit 6da6532

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/facet-.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -744,8 +744,8 @@ Facet <- ggproto("Facet", NULL,
744744
if (identical(unitType(old_width), "null") &&
745745
identical(unitType(old_height), "null")) {
746746
ratio <- as.numeric(old_height) / as.numeric(old_width)
747-
new_widths <- new_widths %||% (new_heights / ratio)
748-
new_heights <- new_heights %||% (new_widths * ratio)
747+
new_widths <- (new_widths %||% (new_heights / ratio))[1]
748+
new_heights <- (new_heights %||% (new_widths * ratio))[1]
749749
}
750750
}
751751

0 commit comments

Comments
 (0)