File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,15 @@ export default class Node extends React.Component {
35
35
}
36
36
37
37
setTransformOrientation ( x , y ) {
38
- const { orientation } = this . props ;
39
- const transform = orientation === 'horizontal' ?
38
+ const { orientation, nodeData, depthFactor } = this . props ;
39
+
40
+ if ( depthFactor ) {
41
+ y = nodeData . depth * depthFactor ;
42
+ }
43
+
44
+ return orientation === 'horizontal' ?
40
45
`translate(${ y } ,${ x } )` :
41
46
`translate(${ x } ,${ y } )` ;
42
- return transform ;
43
47
}
44
48
45
49
applyTransform ( transform , opacity = 1 , done = ( ) => { } ) {
@@ -71,16 +75,12 @@ export default class Node extends React.Component {
71
75
}
72
76
73
77
render ( ) {
74
- const { nodeData, depthFactor , transitions } = this . props ;
78
+ const { nodeData, transitions } = this . props ;
75
79
76
80
const transform = transitions . enabled && this . state . transform ?
77
81
this . state . transform :
78
82
this . setTransformOrientation ( nodeData . x , nodeData . y ) ;
79
83
80
-
81
- if ( depthFactor ) {
82
- nodeData . y = nodeData . depth * depthFactor ;
83
- }
84
84
return (
85
85
< g
86
86
id = { nodeData . id }
You can’t perform that action at this time.
0 commit comments