@@ -96,12 +96,12 @@ scale_colour_continuous <- function(
96
96
}
97
97
98
98
type <- type %|| % " gradient"
99
- args <- list2(... )
99
+ args <- list2(... , aesthetics = aesthetics , guide = guide )
100
100
args $ call <- args $ call %|| % current_call()
101
101
102
102
if (is.function(type )) {
103
- if (! any(c(" ..." , " call " ) %in% fn_fmls_names(type ))) {
104
- args $ call <- NULL
103
+ if (! any(c(" ..." ) %in% fn_fmls_names(type ))) {
104
+ args <- args [intersect(names( args ), fn_fmls_names( type ))]
105
105
}
106
106
check_scale_type(exec(type , !!! args ), " scale_colour_continuous" , " colour" )
107
107
} else if (identical(type , " gradient" )) {
@@ -137,12 +137,12 @@ scale_fill_continuous <- function(
137
137
}
138
138
139
139
type <- type %|| % " gradient"
140
- args <- list2(... )
140
+ args <- list2(... , aesthetics = aesthetics , guide = guide )
141
141
args $ call <- args $ call %|| % current_call()
142
142
143
143
if (is.function(type )) {
144
- if (! any(c(" ..." , " call " ) %in% fn_fmls_names(type ))) {
145
- args $ call <- NULL
144
+ if (! any(c(" ..." ) %in% fn_fmls_names(type ))) {
145
+ args <- args [intersect(names( args ), fn_fmls_names( type ))]
146
146
}
147
147
check_scale_type(exec(type , !!! args ), " scale_fill_continuous" , " fill" )
148
148
} else if (identical(type , " gradient" )) {
@@ -159,7 +159,6 @@ scale_fill_continuous <- function(
159
159
160
160
# ' @export
161
161
# ' @rdname scale_colour_continuous
162
- args <- list2(... )
163
162
scale_colour_binned <- function (
164
163
... ,
165
164
palette = NULL ,
@@ -178,10 +177,11 @@ scale_colour_binned <- function(
178
177
return (scale )
179
178
}
180
179
180
+ args <- list2(... , aesthetics = aesthetics , guide = guide )
181
181
args $ call <- args $ call %|| % current_call()
182
182
if (is.function(type )) {
183
- if (! any(c(" ..." , " call " ) %in% fn_fmls_names(type ))) {
184
- args $ call <- NULL
183
+ if (! any(c(" ..." ) %in% fn_fmls_names(type ))) {
184
+ args <- args [intersect(names( args ), fn_fmls_names( type ))]
185
185
}
186
186
check_scale_type(exec(type , !!! args ), " scale_colour_binned" , " colour" )
187
187
} else {
@@ -226,10 +226,12 @@ scale_fill_binned <- function(
226
226
)
227
227
scale
228
228
}
229
+
230
+ args <- list2(... , aesthetics = aesthetics , guide = guide )
229
231
args $ call <- args $ call %|| % current_call()
230
232
if (is.function(type )) {
231
- if (! any(c(" ..." , " call " ) %in% fn_fmls_names(type ))) {
232
- args $ call <- NULL
233
+ if (! any(c(" ..." ) %in% fn_fmls_names(type ))) {
234
+ args <- args [intersect(names( args ), fn_fmls_names( type ))]
233
235
}
234
236
check_scale_type(exec(type , !!! args ), " scale_fill_binned" , " fill" )
235
237
} else {
@@ -332,8 +334,8 @@ scale_colour_discrete <- function(
332
334
args $ call <- args $ call %|| % current_call()
333
335
334
336
if (is.function(type )) {
335
- if (! any(c(" ..." , " call " ) %in% fn_fmls_names(type ))) {
336
- args $ call <- NULL
337
+ if (! any(c(" ..." ) %in% fn_fmls_names(type ))) {
338
+ args <- args [intersect(names( args ), fn_fmls_names( type ))]
337
339
}
338
340
check_scale_type(
339
341
exec(type , !!! args ),
@@ -370,8 +372,8 @@ scale_fill_discrete <- function(
370
372
args $ call <- args $ call %|| % current_call()
371
373
372
374
if (is.function(type )) {
373
- if (! any(c(" ..." , " call " ) %in% fn_fmls_names(type ))) {
374
- args $ call <- NULL
375
+ if (! any(c(" ..." ) %in% fn_fmls_names(type ))) {
376
+ args <- args [intersect(names( args ), fn_fmls_names( type ))]
375
377
}
376
378
check_scale_type(
377
379
exec(type , !!! args ),
0 commit comments