@@ -18,22 +18,21 @@ class IndentedLayout extends TreeLayout {
18
18
const root = me . rootNode ;
19
19
options . isHorizontal = true ;
20
20
// default indent 20 and sink first children;
21
- const { indent = 20 , dropCap = true } = options ;
22
- const direction = options . direction || DEFAULT_DIRECTION ;
21
+ const { indent = 20 , dropCap = true , direction = DEFAULT_DIRECTION , align } = options ;
23
22
if ( direction && VALID_DIRECTIONS . indexOf ( direction ) === - 1 ) {
24
23
throw new TypeError ( `Invalid direction: ${ direction } ` ) ;
25
24
}
26
25
if ( direction === VALID_DIRECTIONS [ 0 ] ) { // LR
27
- indentedTree ( root , indent , dropCap ) ;
26
+ indentedTree ( root , indent , dropCap , align ) ;
28
27
} else if ( direction === VALID_DIRECTIONS [ 1 ] ) { // RL
29
- indentedTree ( root , indent , dropCap ) ;
28
+ indentedTree ( root , indent , dropCap , align ) ;
30
29
root . right2left ( ) ;
31
30
} else if ( direction === VALID_DIRECTIONS [ 2 ] ) { // H
32
31
// separate into left and right trees
33
32
const { left, right } = separateTree ( root , options ) ;
34
- indentedTree ( left , indent , dropCap ) ;
33
+ indentedTree ( left , indent , dropCap , align ) ;
35
34
left . right2left ( ) ;
36
- indentedTree ( right , indent , dropCap ) ;
35
+ indentedTree ( right , indent , dropCap , align ) ;
37
36
const bbox = left . getBoundingBox ( ) ;
38
37
right . translate ( bbox . width , 0 ) ;
39
38
root . x = right . x - root . width / 2 ;
0 commit comments