Quellcode durchsuchen

fix double bonds from sctruct_conn records

dsehnal vor 3 Jahren
Ursprung
Commit
bee3dc4595
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      src/mol-model/structure/structure/unit/bonds/intra-compute.ts

+ 1 - 1
src/mol-model/structure/structure/unit/bonds/intra-compute.ts

@@ -133,7 +133,7 @@ function findBonds(unit: Unit.Atomic, props: BondComputationProps): IntraUnitBon
 
                 const p = partnerA.atomIndex === aI ? partnerB : partnerA;
                 const _bI = SortedArray.indexOf(unit.elements, p.atomIndex) as StructureElement.UnitIndex;
-                if (_bI < 0) continue;
+                if (_bI < 0 || atoms[_bI] < aI) continue;
 
                 atomA[atomA.length] = _aI;
                 atomB[atomB.length] = _bI;