Browse Source

fixed link fromGroup location-iterator to use instance

Alexander Rose 6 years ago
parent
commit
d5388cf902
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/mol-geo/representation/structure/visual/util/link.ts

+ 4 - 2
src/mol-geo/representation/structure/visual/util/link.ts

@@ -126,8 +126,10 @@ export namespace LinkIterator {
         const unit = group.units[0]
         const groupCount = Unit.isAtomic(unit) ? unit.links.edgeCount * 2 : 0
         const instanceCount = group.units.length
-        const location = StructureElement.create(unit)
-        const getLocation = (groupIndex: number) => {
+        const location = StructureElement.create()
+        const getLocation = (groupIndex: number, instanceIndex: number) => {
+            const unit = group.units[instanceIndex]
+            location.unit = unit
             location.element = unit.elements[(unit as Unit.Atomic).links.a[groupIndex]]
             return location
         }