Skip to content

Ensure that draw_axis() works with element_text() subclasses #3381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions R/guides-axis.r
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ draw_axis <- function(break_positions, break_labels, axis_position, theme,

# override label element parameters for rotation
if (inherits(label_element, "element_text")) {
label_element <- merge_element(
axis_label_element_overrides(axis_position, angle),
label_element
)
label_overrides <- axis_label_element_overrides(axis_position, angle)
# label_overrides is always an element_text(), but in order for the merge to
# keep the new class, the override must also have the new class
class(label_overrides) <- class(label_element)
label_element <- merge_element(label_overrides, label_element)
}

# conditionally set parameters that depend on axis orientation
Expand Down