Explorar el Código

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

David Sehnal hace 4 años
padre
commit
2747c743c9
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  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) {