Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/core/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,9 @@ export default class View extends Component {

this.openglRenderWindow = props.renderWindowView;

if (props.interactive) {
this.interactor = props.interactor;
this.defaultStyle = vtkInteractorStyleManipulator.newInstance();
this.style = this.defaultStyle;
}
this.interactor = props.interactor;
this.defaultStyle = vtkInteractorStyleManipulator.newInstance();
this.style = props.interactive ? this.defaultStyle : null;

// Create orientation widget
this.axesActor = vtkAxesActor.newInstance();
Expand Down Expand Up @@ -194,8 +192,10 @@ export default class View extends Component {
this.debouncedCubeBounds = debounce(this.updateCubeBounds, 50);

this.setInteractorStyle = (style) => {
this.style = style;
this.interactor.setInteractorStyle(style);
if (this.props.interactive) {
this.style = style;
this.interactor.setInteractorStyle(style);
}
};

// Internal functions
Expand Down
2 changes: 1 addition & 1 deletion src/core/ViewContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class ViewController extends Component {
} else {
this.renderWindow = vtkRenderWindow.newInstance();
this.openglRenderWindow = vtkOpenGLRenderWindow.newInstance();
this.interactor = vtkRenderWindowInteractor.newInstance();
}

this.onEnter = this.onEnter.bind(this);
Expand All @@ -32,7 +33,6 @@ class ViewController extends Component {
if (!this.props.root) {
this.renderWindow.addView(this.openglRenderWindow);

this.interactor = vtkRenderWindowInteractor.newInstance();
if (this.props.interactive) {
this.interactor.setView(this.openglRenderWindow);
this.interactor.initialize();
Expand Down