Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
legend glyphs (@teunbrand, #6594)
* Fixed regression where `NULL`-aesthetics contributed to plot labels too
insistently. Now they contribute only as fallback labels (@teunbrand, #6616)
* Fixed regression where empty arguments to colour/fill scale caused errors
(@jmbarbone, #6710)
* The `theme(panel.widths, panel.heights)` setting attempts to preserve the
plot's aspect ratio when only one of the two settings is given, and the plot
has a single panel (@teunbrand, #6701).
Expand Down
3 changes: 2 additions & 1 deletion R/scale-colour.R
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ check_scale_type <- function(scale, name, aesthetic, scale_is_discrete = FALSE,
scale_backward_compatibility <- function(..., scale, aesthetic, type) {
aesthetic <- standardise_aes_names(aesthetic[1])

args <- list2(...)
# input ... may have trailing args, which then get stuck in the middle #6710
args <- dots_list(..., .ignore_empty = "all")
args$call <- args$call %||% caller_call() %||% current_call()

if (type == "binned") {
Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test-scale-colour.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,7 @@ test_that("`name` is directed correctly (#6623)", {
expect_equal(p$name, "foobar")
}
})

test_that("backwards compatibility allows trailing args (#6710)", {
expect_no_error(scale_fill_discrete(breaks = 1:2, direction = -1L, ))
})