Skip to content

Commit 7bacadd

Browse files
committed
fix(View): disable style when not interactive
1 parent f6e5f27 commit 7bacadd

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/core/View.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)