From c6d7ae65889d669142632f5de9ad5b871297d968 Mon Sep 17 00:00:00 2001 From: Federico Zivolo Date: Tue, 10 Aug 2021 15:35:32 +0200 Subject: [PATCH] =?UTF-8?q?fix(View):=20don=E2=80=99t=20throw=20cannot=20g?= =?UTF-8?q?et=20getViewMatrix=20of=20undefined=20error=20when=20shoeCubeAx?= =?UTF-8?q?es=20is=20set=20to=20false?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/View.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/View.js b/src/core/View.js index aa5ecbc..5148e21 100644 --- a/src/core/View.js +++ b/src/core/View.js @@ -166,6 +166,10 @@ export default class View extends Component { this.resetCamera = this.resetCamera.bind(this); const bbox = vtkBoundingBox.newInstance({ bounds: [0, 0, 0, 0, 0, 0] }); this.updateCubeBounds = () => { + if (!this.props.showCubeAxes) { + return; + } + bbox.reset(); const { props } = this.renderer.get('props'); for (let i = 0; i < props.length; i++) { @@ -556,8 +560,8 @@ export default class View extends Component { const representationIds = []; this.selections.forEach((v) => { const { prop } = v.getProperties(); - const representationId = - prop?.get('representationId').representationId; + const representationId = prop?.get('representationId') + .representationId; if (representationId) { representationIds.push(representationId); }