@@ -282,11 +282,9 @@ FacetZoom <- ggproto('FacetZoom', Facet,
282
282
}
283
283
284
284
if (' full' %in% layout $ name && params $ split ) {
285
- space.x <- theme $ panel.spacing.x
286
- if (is.null(space.x )) space.x <- theme $ panel.spacing
285
+ space.x <- calc_element(" panel.spacing.x" , theme )
287
286
space.x <- unit(5 * as.numeric(convertUnit(space.x , ' cm' )), ' cm' )
288
- space.y <- theme $ panel.spacing.y
289
- if (is.null(space.y )) space.y <- theme $ panel.spacing
287
+ space.y <- calc_element(" panel.spacing.y" , theme )
290
288
space.y <- unit(5 * as.numeric(convertUnit(space.y , ' cm' )), ' cm' )
291
289
final <- gtable_add_cols(panelGrobs [[3 ]], space.x )
292
290
final <- cbind(final , panelGrobs [[1 ]], size = ' first' )
@@ -320,8 +318,7 @@ FacetZoom <- ggproto('FacetZoom', Facet,
320
318
final $ widths <- widths
321
319
} else {
322
320
if (params $ horizontal ) {
323
- space <- theme $ panel.spacing.x
324
- if (is.null(space )) space <- theme $ panel.spacing
321
+ space <- calc_element(" panel.spacing.x" , theme )
325
322
space <- unit(5 * as.numeric(convertUnit(space , ' cm' )), ' cm' )
326
323
heights <- unit.c(
327
324
unit(max_height(list (axes $ x [[1 ]]$ top , axes $ x [[2 ]]$ top )), ' cm' ),
@@ -335,8 +332,7 @@ FacetZoom <- ggproto('FacetZoom', Facet,
335
332
final <- gtable_add_grob(final , indicator_h , 2 , 3 , 2 , 5 , z = - Inf ,
336
333
name = ' zoom-indicator' )
337
334
} else {
338
- space <- theme $ panel.spacing.y
339
- if (is.null(space )) space <- theme $ panel.spacing
335
+ space <- calc_element(" panel.spacing.y" , theme )
340
336
space <- unit(5 * as.numeric(convertUnit(space , ' cm' )), ' cm' )
341
337
widths <- unit.c(
342
338
unit(max_width(list (axes $ y [[1 ]]$ left , axes $ y [[2 ]]$ left )), ' cm' ),
0 commit comments