Explorar o código

better handle focus on structure update

- fixes #123
Alexander Rose %!s(int64=4) %!d(string=hai) anos
pai
achega
189fad3d84
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      src/mol-plugin-state/manager/structure/focus.ts

+ 3 - 0
src/mol-plugin-state/manager/structure/focus.ts

@@ -164,7 +164,10 @@ export class StructureFocusManager extends StatefulPluginComponent<StructureFocu
 
         plugin.state.data.events.object.updated.subscribe(({ oldData, obj, action }) => {
             if (!PluginStateObject.Molecule.Structure.is(obj)) return;
+            // structure NOT changed, keep everything as is; fixes #123
+            if (oldData === obj.data) return;
 
+            // structure changed (e.g. coordinates), try to remap and re-focus
             if (action === 'in-place') {
                 const current = this.state.current;
                 const structure = obj.data as Structure;