Explorar o código

StructureComponentManager.updateRepresentations tweak

David Sehnal %!s(int64=5) %!d(string=hai) anos
pai
achega
28415646a2
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  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);
         }