Skip to content
Snippets Groups Projects
Commit 1316cc6a authored by Alexander Rose's avatar Alexander Rose
Browse files

fix StructureSelectionControls.focus for single element

parent 944d370c
Branches
No related tags found
No related merge requests found
...@@ -46,8 +46,8 @@ export class StructureSelectionControls<P, S extends StructureSelectionControlsS ...@@ -46,8 +46,8 @@ export class StructureSelectionControls<P, S extends StructureSelectionControlsS
focus = () => { focus = () => {
const { extraRadius, minRadius, durationMs } = this.state const { extraRadius, minRadius, durationMs } = this.state
if (this.plugin.helpers.structureSelectionManager.stats.elementCount === 0) return
const { sphere } = this.plugin.helpers.structureSelectionManager.getBoundary(); const { sphere } = this.plugin.helpers.structureSelectionManager.getBoundary();
if (sphere.radius === 0) return
const radius = Math.max(sphere.radius + extraRadius, minRadius); const radius = Math.max(sphere.radius + extraRadius, minRadius);
this.plugin.canvas3d.camera.focus(sphere.center, radius, durationMs); this.plugin.canvas3d.camera.focus(sphere.center, radius, durationMs);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment