File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -147,7 +147,8 @@ export class LayoutProvider {
147147 this . set_visible ( node . children , false ) ;
148148 }
149149 node_outer_height = Math . max ( node . _data . view . height , node_outer_height ) ;
150- if ( node . children . length > 1 ) {
150+
151+ if ( this . _should_reserve_cousin_space ( node ) ) {
151152 node_outer_height += this . opts . cousin_space ;
152153 }
153154
@@ -196,7 +197,7 @@ export class LayoutProvider {
196197 node_outer_height = 0 ;
197198 }
198199 node_outer_height = Math . max ( node . _data . view . height , node_outer_height ) ;
199- if ( node . children . length > 1 ) {
200+ if ( this . _should_reserve_cousin_space ( node ) ) {
200201 node_outer_height += this . opts . cousin_space ;
201202 }
202203
@@ -216,6 +217,9 @@ export class LayoutProvider {
216217 }
217218 return total_height ;
218219 }
220+ _should_reserve_cousin_space ( node ) {
221+ return node . children . length > 0 && node . parent . children . length > 1 ;
222+ }
219223 get_node_offset ( node ) {
220224 var layout_data = node . _data . layout ;
221225 var offset_cache = null ;
You can’t perform that action at this time.
0 commit comments