Ver Fonte

StructureComponentManager.updateRepresentations tweak

David Sehnal há 5 anos atrás
pai
commit
28415646a2
1 ficheiros alterados com 5 adições e 2 exclusões
  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);
         const index = components[0].representations.indexOf(pivot);
         if (index < 0) return Promise.resolve();
         if (index < 0) return Promise.resolve();
-
+        
         const update = this.dataState.build();
         const update = this.dataState.build();
-
+        
         for (const c of components) {
         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];
             const repr = c.representations[index];
             if (!repr) continue;
             if (!repr) continue;
+            if (repr.cell.transform.transformer !== pivot.cell.transform.transformer) continue;
+
             update.to(repr.cell).update(params);
             update.to(repr.cell).update(params);
         }
         }