Skip to content

Commit b0575fc

Browse files
committed
width and height must be 1 npc to preserve aspect ratio
1 parent 19bdcf2 commit b0575fc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

R/build_grobs.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ build_grobs <- function(i, alpha, colour, path, data,
5858
vp = grid::viewport(
5959
x = grid::unit(data$x[i], "npc"),
6060
y = grid::unit(data$y[i], "npc"),
61-
width = data$width[i],
62-
height = data$height[i],
61+
width = grid::unit(data$width[i], "npc"),
62+
height = grid::unit(data$height[i], "npc"),
6363
angle = data$angle[i]
6464
),
6565
just = c(data$hjust[i], data$vjust[i]),

R/theme_element.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ S7::method(draw_element, element_path) <- function(
219219
y = as.numeric(y),
220220
hjust = rep(hj, n),
221221
vjust = rep(vj, n),
222-
width = rep(size, n),
223-
height = rep(size, n),
222+
width = rep(1, n),
223+
height = rep(1, n),
224224
angle = rep(angle, n)
225225
),
226226
is_theme_element = TRUE

0 commit comments

Comments
 (0)