@@ -134,12 +134,12 @@ layer <- function(geom = NULL, stat = NULL,
134
134
135
135
# Split up params between aesthetics, geom, and stat
136
136
params <- rename_aes(params )
137
- aes_params <- params [intersect(names(params ), geom $ aesthetics())]
137
+ aes_params <- params [intersect(names(params ), union( geom $ aesthetics(), position $ aesthetics() ))]
138
138
geom_params <- params [intersect(names(params ), geom $ parameters(TRUE ))]
139
139
stat_params <- params [intersect(names(params ), stat $ parameters(TRUE ))]
140
140
141
141
ignore <- c(" key_glyph" , " name" )
142
- all <- c(geom $ parameters(TRUE ), stat $ parameters(TRUE ), geom $ aesthetics(), ignore )
142
+ all <- c(geom $ parameters(TRUE ), stat $ parameters(TRUE ), geom $ aesthetics(), position $ aesthetics(), ignore )
143
143
144
144
# Take care of plain patterns provided as aesthetic
145
145
pattern <- vapply(aes_params , is_pattern , logical (1 ))
@@ -170,7 +170,7 @@ layer <- function(geom = NULL, stat = NULL,
170
170
171
171
extra_aes <- setdiff(
172
172
mapped_aesthetics(mapping ),
173
- c(geom $ aesthetics(), stat $ aesthetics())
173
+ c(geom $ aesthetics(), stat $ aesthetics(), position $ aesthetics() )
174
174
)
175
175
# Take care of size->linewidth aes renaming
176
176
if (geom $ rename_size && " size" %in% extra_aes && ! " linewidth" %in% mapped_aesthetics(mapping )) {
0 commit comments