File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -999,22 +999,24 @@ combine_elements <- function(e1, e2) {
999
999
}
1000
1000
}
1001
1001
1002
+ parent_props <- if (S7 :: S7_inherits(e2 )) S7 :: props(e2 ) else unclass(e2 )
1003
+
1002
1004
# If e1 has any NULL properties, inherit them from e2
1003
1005
n <- S7 :: prop_names(e1 )[lengths(S7 :: props(e1 )) == 0 ]
1004
- S7 :: props(e1 )[n ] <- S7 :: props( e2 ) [n ]
1006
+ S7 :: props(e1 )[n ] <- parent_props [n ]
1005
1007
1006
1008
# Calculate relative sizes
1007
1009
if (is_rel(try_prop(e1 , " size" ))) {
1008
- e1 @ size <- e2 @ size * unclass(e1 @ size )
1010
+ e1 @ size <- parent_props $ size * unclass(e1 @ size )
1009
1011
}
1010
1012
1011
1013
# Calculate relative linewidth
1012
1014
if (is_rel(try_prop(e1 , " linewidth" ))) {
1013
- e1 @ linewidth <- e2 @ linewidth * unclass(e1 @ linewidth )
1015
+ e1 @ linewidth <- parent_props $ linewidth * unclass(e1 @ linewidth )
1014
1016
}
1015
1017
1016
1018
if (is_theme_element(e1 , " text" )) {
1017
- e1 @ margin <- combine_elements(e1 @ margin , e2 @ margin )
1019
+ e1 @ margin <- combine_elements(e1 @ margin , parent_props $ margin )
1018
1020
}
1019
1021
1020
1022
# If e2 is 'richer' than e1, fill e2 with e1 parameters
You can’t perform that action at this time.
0 commit comments