Skip to content

Commit 08de90d

Browse files
Merge mapping in setup_layer()
1 parent b6de158 commit 08de90d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

R/layer.r

+6
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,12 @@ Layer <- ggproto("Layer", NULL,
203203
# hook to allow a layer access to the final layer data
204204
# in input form and to global plot info
205205
setup_layer = function(self, data, plot) {
206+
if (isTRUE(self$inherit.aes)) {
207+
self$mapping <- defaults(self$mapping, plot$mapping)
208+
# defaults() strips class, but it needs to be preserved for now
209+
class(self$mapping) <- "uneval"
210+
}
211+
206212
data
207213
},
208214

0 commit comments

Comments
 (0)