Skip to content

Commit 384c14a

Browse files
authored
Merge pull request #33 from FezVrasta/fix/getviewmatrix-of-undefined
fix(View): don’t throw `cannot get getViewMatrix of undefined` error when showCubeAxes is set to false
2 parents 41febdc + c6d7ae6 commit 384c14a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/core/View.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ export default class View extends Component {
166166
this.resetCamera = this.resetCamera.bind(this);
167167
const bbox = vtkBoundingBox.newInstance({ bounds: [0, 0, 0, 0, 0, 0] });
168168
this.updateCubeBounds = () => {
169+
if (!this.props.showCubeAxes) {
170+
return;
171+
}
172+
169173
bbox.reset();
170174
const { props } = this.renderer.get('props');
171175
for (let i = 0; i < props.length; i++) {
@@ -556,8 +560,8 @@ export default class View extends Component {
556560
const representationIds = [];
557561
this.selections.forEach((v) => {
558562
const { prop } = v.getProperties();
559-
const representationId =
560-
prop?.get('representationId').representationId;
563+
const representationId = prop?.get('representationId')
564+
.representationId;
561565
if (representationId) {
562566
representationIds.push(representationId);
563567
}

0 commit comments

Comments
 (0)