Преглед изворни кода

StructureComponentManager.updateRepresentations tweak

David Sehnal пре 5 година
родитељ
комит
28415646a2
1 измењених фајлова са 5 додато и 2 уклоњено
  1. 5 2
      src/mol-plugin-state/manager/structure/component.ts

+ 5 - 2
src/mol-plugin-state/manager/structure/component.ts

@@ -182,12 +182,15 @@ class StructureComponentManager extends PluginComponent<StructureComponentManage
 
         const index = components[0].representations.indexOf(pivot);
         if (index < 0) return Promise.resolve();
-
+        
         const update = this.dataState.build();
-
+        
         for (const c of components) {
+            // TODO: is it ok to use just the index here? Could possible lead to ugly edge cases, but perhaps not worth the trouble to "fix".
             const repr = c.representations[index];
             if (!repr) continue;
+            if (repr.cell.transform.transformer !== pivot.cell.transform.transformer) continue;
+
             update.to(repr.cell).update(params);
         }