File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -622,21 +622,28 @@ merge_element.element <- function(new, old) {
622
622
combine_elements <- function (e1 , e2 ) {
623
623
624
624
# If e2 is NULL, nothing to inherit
625
- if (is.null(e2 ) || inherits(e1 , " element_blank" )) return (e1 )
625
+ if (is.null(e2 ) || inherits(e1 , " element_blank" )) {
626
+ return (e1 )
627
+ }
626
628
627
629
# If e1 is NULL inherit everything from e2
628
- if (is.null(e1 )) return (e2 )
630
+ if (is.null(e1 )) {
631
+ return (e2 )
632
+ }
629
633
630
634
# If neither of e1 or e2 are element_* objects, return e1
631
- if (! inherits(e1 , " element" ) && ! inherits(e2 , " element" )) return (e1 )
635
+ if (! inherits(e1 , " element" ) && ! inherits(e2 , " element" )) {
636
+ return (e1 )
637
+ }
632
638
633
639
# If e2 is element_blank, and e1 inherits blank inherit everything from e2,
634
640
# otherwise ignore e2
635
641
if (inherits(e2 , " element_blank" )) {
636
- if (e1 $ inherit.blank )
642
+ if (e1 $ inherit.blank ) {
637
643
return (e2 )
638
- else
644
+ } else {
639
645
return (e1 )
646
+ }
640
647
}
641
648
642
649
# If e1 has any NULL properties, inherit them from e2
You can’t perform that action at this time.
0 commit comments