From ed1bc8cb7d5c8412b9a58a840df4f8fedc08e2b2 Mon Sep 17 00:00:00 2001 From: Alexander Rose <alex.rose@rcsb.org> Date: Mon, 30 Sep 2019 14:49:37 -0700 Subject: [PATCH] ensure single element loci have some volume in volume interaction behavior --- .../behavior/dynamic/volume-streaming/behavior.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mol-plugin/behavior/dynamic/volume-streaming/behavior.ts b/src/mol-plugin/behavior/dynamic/volume-streaming/behavior.ts index c094202e6..e9640e9b8 100644 --- a/src/mol-plugin/behavior/dynamic/volume-streaming/behavior.ts +++ b/src/mol-plugin/behavior/dynamic/volume-streaming/behavior.ts @@ -244,7 +244,12 @@ export namespace VolumeStreaming { const root = this.getStructureRoot(); if (!root || !root.obj || root.obj !== parent.obj) return Box3D.empty(); - return StructureElement.Loci.getBoundary(StructureElement.Loci.extendToWholeResidues(loci)).box; + const extendedLoci = StructureElement.Loci.extendToWholeResidues(loci) + const box = StructureElement.Loci.getBoundary(extendedLoci).box + if (StructureElement.Loci.size(extendedLoci) === 1) { + Box3D.expand(box, box, Vec3.create(1, 1, 1)) + } + return box; } private updateInteraction(current: Representation.Loci) { @@ -263,7 +268,6 @@ export namespace VolumeStreaming { } const box = this.getBoxFromLoci(loci); - if (!box) return; this.updateDynamicBox(box); } -- GitLab