Sfoglia il codice sorgente

fix ElementLocationIterator.advance
- extra element was added if last unit size === 1

David Sehnal 5 anni fa
parent
commit
2747c743c9
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      src/mol-model/structure/structure/structure.ts

+ 3 - 0
src/mol-model/structure/structure/structure.ts

@@ -956,6 +956,9 @@ namespace Structure {
             this.current.unit = this.structure.units[this.unitIndex];
             this.elements = this.current.unit.elements;
             this.maxIdx = this.elements.length - 1;
+            if (this.maxIdx === 0) {
+                this.hasNext = this.unitIndex + 1 < this.structure.units.length;
+            }
         }
 
         constructor(private structure: Structure) {