From f2f730bab5c0b535bd9d9af96a90934644e54371 Mon Sep 17 00:00:00 2001
From: Alexander Rose <alexander.rose@weirdbyte.de>
Date: Sun, 4 Sep 2022 22:41:06 -0700
Subject: [PATCH] fix parentDisplay 'between' logic

---
 src/apps/docking-viewer/index.ts                          | 2 +-
 .../representations/interactions-inter-unit-cylinder.ts   | 2 +-
 .../representations/interactions-intra-unit-cylinder.ts   | 8 ++++----
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/apps/docking-viewer/index.ts b/src/apps/docking-viewer/index.ts
index 8242e6203..a1fd57969 100644
--- a/src/apps/docking-viewer/index.ts
+++ b/src/apps/docking-viewer/index.ts
@@ -166,7 +166,7 @@ class Viewer {
             structures.push({ ref: structureProperties?.ref || structure.ref });
         }
 
-        // remove current structuresfrom hierarchy as they will be merged
+        // remove current structures from hierarchy as they will be merged
         // TODO only works with using loadStructuresFromUrlsAndMerge once
         //      need some more API metho to work with the hierarchy
         this.plugin.managers.structure.hierarchy.updateCurrent(this.plugin.managers.structure.hierarchy.current.structures, 'remove');
diff --git a/src/mol-model-props/computed/representations/interactions-inter-unit-cylinder.ts b/src/mol-model-props/computed/representations/interactions-inter-unit-cylinder.ts
index 5bd9d6574..9a0d91642 100644
--- a/src/mol-model-props/computed/representations/interactions-inter-unit-cylinder.ts
+++ b/src/mol-model-props/computed/representations/interactions-inter-unit-cylinder.ts
@@ -111,7 +111,7 @@ function createInterUnitInteractionCylinderMesh(ctx: VisualContext, structure: S
                         }
                     }
 
-                    return parentDisplay === 'full' ? flagA && flagB : flagA !== flagB;
+                    return parentDisplay === 'full' ? flagA && flagB : flagA === flagB;
                 } else {
                     assertUnreachable(parentDisplay);
                 }
diff --git a/src/mol-model-props/computed/representations/interactions-intra-unit-cylinder.ts b/src/mol-model-props/computed/representations/interactions-intra-unit-cylinder.ts
index 64f180a9e..e0289f7b7 100644
--- a/src/mol-model-props/computed/representations/interactions-intra-unit-cylinder.ts
+++ b/src/mol-model-props/computed/representations/interactions-intra-unit-cylinder.ts
@@ -64,7 +64,7 @@ async function createIntraUnitInteractionsCylinderMesh(ctx: VisualContext, unit:
             if (childUnit) {
                 if (parentDisplay === 'stub') {
                     const f = a[edgeIndex];
-                    for (let i = offsets[f], jl = offsets[f + 1]; i < jl; ++i) {
+                    for (let i = offsets[f], il = offsets[f + 1]; i < il; ++i) {
                         const e = unit.elements[members[offsets[i]]];
                         if (!SortedArray.has(childUnit.elements, e)) return true;
                     }
@@ -73,18 +73,18 @@ async function createIntraUnitInteractionsCylinderMesh(ctx: VisualContext, unit:
                     let flagB = false;
 
                     const fA = a[edgeIndex];
-                    for (let i = offsets[fA], jl = offsets[fA + 1]; i < jl; ++i) {
+                    for (let i = offsets[fA], il = offsets[fA + 1]; i < il; ++i) {
                         const eA = unit.elements[members[offsets[i]]];
                         if (!SortedArray.has(childUnit.elements, eA)) flagA = true;
                     }
 
                     const fB = b[edgeIndex];
-                    for (let i = offsets[fB], jl = offsets[fB + 1]; i < jl; ++i) {
+                    for (let i = offsets[fB], il = offsets[fB + 1]; i < il; ++i) {
                         const eB = unit.elements[members[offsets[i]]];
                         if (!SortedArray.has(childUnit.elements, eB)) flagB = true;
                     }
 
-                    return parentDisplay === 'full' ? flagA && flagB : flagA !== flagB;
+                    return parentDisplay === 'full' ? flagA && flagB : flagA === flagB;
                 } else {
                     assertUnreachable(parentDisplay);
                 }
-- 
GitLab