浏览代码

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

David Sehnal 5 年之前
父节点
当前提交
2747c743c9
共有 1 个文件被更改,包括 3 次插入0 次删除
  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) {