File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -133,11 +133,9 @@ export default class View extends Component {
133133
134134 this . openglRenderWindow = props . renderWindowView ;
135135
136- if ( props . interactive ) {
137- this . interactor = props . interactor ;
138- this . defaultStyle = vtkInteractorStyleManipulator . newInstance ( ) ;
139- this . style = this . defaultStyle ;
140- }
136+ this . interactor = props . interactor ;
137+ this . defaultStyle = vtkInteractorStyleManipulator . newInstance ( ) ;
138+ this . style = props . interactive ? this . defaultStyle : null ;
141139
142140 // Create orientation widget
143141 this . axesActor = vtkAxesActor . newInstance ( ) ;
@@ -194,8 +192,10 @@ export default class View extends Component {
194192 this . debouncedCubeBounds = debounce ( this . updateCubeBounds , 50 ) ;
195193
196194 this . setInteractorStyle = ( style ) => {
197- this . style = style ;
198- this . interactor . setInteractorStyle ( style ) ;
195+ if ( this . props . interactive ) {
196+ this . style = style ;
197+ this . interactor . setInteractorStyle ( style ) ;
198+ }
199199 } ;
200200
201201 // Internal functions
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ class ViewController extends Component {
2222 } else {
2323 this . renderWindow = vtkRenderWindow . newInstance ( ) ;
2424 this . openglRenderWindow = vtkOpenGLRenderWindow . newInstance ( ) ;
25+ this . interactor = vtkRenderWindowInteractor . newInstance ( ) ;
2526 }
2627
2728 this . onEnter = this . onEnter . bind ( this ) ;
@@ -32,7 +33,6 @@ class ViewController extends Component {
3233 if ( ! this . props . root ) {
3334 this . renderWindow . addView ( this . openglRenderWindow ) ;
3435
35- this . interactor = vtkRenderWindowInteractor . newInstance ( ) ;
3636 if ( this . props . interactive ) {
3737 this . interactor . setView ( this . openglRenderWindow ) ;
3838 this . interactor . initialize ( ) ;
You can’t perform that action at this time.
0 commit comments