Quellcode durchsuchen

removed LociHighligh command extend

David Sehnal vor 5 Jahren
Ursprung
Commit
768ec10809

+ 1 - 5
src/mol-plugin-ui/structure/components.tsx

@@ -258,12 +258,8 @@ class StructureComponentGroup extends PurePluginUIComponent<{ group: StructureCo
     highlight = (e: React.MouseEvent<HTMLElement>) => {
         e.preventDefault();
 
-        PluginCommands.State.Highlight(this.plugin, { state: this.props.group[0].cell.parent, ref: this.props.group[0].cell.transform.ref });
-
-        let first = true;
         for (const c of this.props.group) {
-            if (first) { first = false; continue; }
-            PluginCommands.State.Highlight(this.plugin, { state: c.cell.parent, ref: c.cell.transform.ref, extend: true });
+            PluginCommands.State.Highlight(this.plugin, { state: c.cell.parent, ref: c.cell.transform.ref });
         }
     }
 

+ 3 - 5
src/mol-plugin/behavior/static/state.ts

@@ -104,16 +104,14 @@ function setVisibilityVisitor(t: StateTransform, tree: StateTree, ctx: { state:
 }
 
 export function Highlight(ctx: PluginContext) {
-    PluginCommands.State.Highlight.subscribe(ctx, ({ state, ref, extend }) => {
+    PluginCommands.State.Highlight.subscribe(ctx, ({ state, ref }) => {
         const cell = state.select(ref)[0];
         if (!cell) return;
         if (SO.Molecule.Structure.is(cell.obj)) {
-            if (extend) ctx.managers.interactivity.lociHighlights.highlightOnlyExtend({ loci: Structure.Loci(cell.obj.data) }, false);
-            else ctx.managers.interactivity.lociHighlights.highlightOnly({ loci: Structure.Loci(cell.obj.data) }, false);
+            ctx.managers.interactivity.lociHighlights.highlightOnly({ loci: Structure.Loci(cell.obj.data) }, false);
         } else if (cell && SO.isRepresentation3D(cell.obj)) {
             const { repr } = cell.obj.data
-            if (extend) ctx.managers.interactivity.lociHighlights.highlightOnlyExtend({ loci: repr.getLoci(), repr }, false);
-            else ctx.managers.interactivity.lociHighlights.highlightOnly({ loci: repr.getLoci(), repr }, false);
+            ctx.managers.interactivity.lociHighlights.highlightOnly({ loci: repr.getLoci(), repr }, false);
         } else if (SO.Molecule.Structure.Selections.is(cell.obj)) {
             ctx.managers.interactivity.lociHighlights.clearHighlights();
             for (const entry of cell.obj.data) {

+ 1 - 1
src/mol-plugin/commands.ts

@@ -24,7 +24,7 @@ export const PluginCommands = {
 
         ToggleExpanded: PluginCommand<{ state: State, ref: StateTransform.Ref }>(),
         ToggleVisibility: PluginCommand<{ state: State, ref: StateTransform.Ref }>(),
-        Highlight: PluginCommand<{ state: State, ref: StateTransform.Ref, extend?: boolean }>(),
+        Highlight: PluginCommand<{ state: State, ref: StateTransform.Ref }>(),
         ClearHighlight: PluginCommand<{ state: State, ref: StateTransform.Ref }>(),
 
         Snapshots: {