File tree 1 file changed +7
-10
lines changed
1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -24,24 +24,21 @@ class ViewController extends Component {
24
24
this . renderWindow = vtkRenderWindow . newInstance ( ) ;
25
25
this . openglRenderWindow = vtkOpenGLRenderWindow . newInstance ( ) ;
26
26
this . interactor = vtkRenderWindowInteractor . newInstance ( ) ;
27
- }
28
27
29
- this . onEnter = this . onEnter . bind ( this ) ;
30
- this . onResize = this . onResize . bind ( this ) ;
31
- this . setViewRef = this . setViewRef . bind ( this ) ;
32
- }
33
-
34
- componentDidMount ( ) {
35
- if ( ! this . props . root ) {
36
28
this . renderWindow . addView ( this . openglRenderWindow ) ;
37
-
38
- if ( this . props . interactive ) {
29
+ if ( props . interactive ) {
39
30
this . interactor . setView ( this . openglRenderWindow ) ;
40
31
this . interactor . initialize ( ) ;
41
32
}
42
33
}
34
+
43
35
this . renderWindow . addRenderer ( this . renderer ) ;
36
+ this . onEnter = this . onEnter . bind ( this ) ;
37
+ this . onResize = this . onResize . bind ( this ) ;
38
+ this . setViewRef = this . setViewRef . bind ( this ) ;
39
+ }
44
40
41
+ componentDidMount ( ) {
45
42
const container = this . view ?. containerRef . current ;
46
43
if ( this . view && container ) {
47
44
container . addEventListener ( 'pointerenter' , this . onEnter ) ;
You can’t perform that action at this time.
0 commit comments