Skip to content

Commit fc2dc4d

Browse files
committed
Fix presumptuous theme element assignment
When the theme element does not exist, there should be no assigment to any of it's attributes. There was only a single instance of this.
1 parent 6dd2836 commit fc2dc4d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

R/labeller.r

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,9 @@ build_strip <- function(label_df, labeller, theme, horizontal) {
509509
grobs_right <- apply(grobs_right, 1, function(strips) {
510510
gtable_matrix("strip", matrix(strips, nrow = 1), widths, unit(1, "null"), clip = "on")
511511
})
512-
theme$strip.text.y$angle <- adjust_angle(theme$strip.text.y$angle)
512+
if (inherits(theme$strip.text.y, "element_text")) {
513+
theme$strip.text.y$angle <- adjust_angle(theme$strip.text.y$angle)
514+
}
513515
grobs_left <- apply(labels, c(1, 2), ggstrip, theme = theme,
514516
horizontal = horizontal)
515517
widths <- unit(apply(grobs_left, 2, max_width), "cm")

0 commit comments

Comments
 (0)