Browse Source

FocusLoci fix
- was calling camera.focusLoci twice
- broken for transformed structures

David Sehnal 5 years ago
parent
commit
dc89f33cd0
1 changed files with 7 additions and 4 deletions
  1. 7 4
      src/mol-plugin/behavior/dynamic/camera.ts

+ 7 - 4
src/mol-plugin/behavior/dynamic/camera.ts

@@ -47,12 +47,15 @@ export const FocusLoci = PluginBehavior.create<FocusLociProps>({
                     : this.params.bindings.clickCenterFocus;
 
                 if (Binding.match(binding, button, modifiers)) {
-                    const loci = Loci.normalize(current.loci, this.ctx.managers.interactivity.props.granularity);
-                    if (Loci.isEmpty(loci)) {
+                    if (Loci.isEmpty(current.loci)) {
                         PluginCommands.Camera.Reset(this.ctx, { });
-                    } else {
-                        this.ctx.managers.camera.focusLoci(loci, this.params);
+                        return;
                     }
+
+                    // The focus is handled in structure-focus-representation
+                    // TODO: is there a better solution?
+                    // const loci = Loci.normalize(current.loci, this.ctx.managers.interactivity.props.granularity);
+                    // this.ctx.managers.camera.focusLoci(loci, this.params);
                 }
             });
         }