Ver Fonte

optimize LociSelectManager.selectOnly

- avoid superfluous loci set operations
Alexander Rose há 1 ano atrás
pai
commit
5d139b6db8
2 ficheiros alterados com 2 adições e 1 exclusões
  1. 1 0
      CHANGELOG.md
  2. 1 1
      src/mol-plugin-state/manager/interactivity.ts

+ 1 - 0
CHANGELOG.md

@@ -24,6 +24,7 @@ Note that since we don't clearly distinguish between a public and private interf
 - Add drag&drop for `.mvsj` files
 - Fix `bumpiness` scaling with `ignoreLight` enabled
 - Add `transforms` & `label` params to `ShapeFromPly`
+- Optimize `LociSelectManager.selectOnly` to avoid superfluous loci set operations
 
 ## [v3.42.0] - 2023-11-05
 

+ 1 - 1
src/mol-plugin-state/manager/interactivity.ts

@@ -228,7 +228,7 @@ namespace InteractivityManager {
             const normalized = this.normalizedLoci(current, applyGranularity, true);
             if (StructureElement.Loci.is(normalized.loci)) {
                 // only deselect for the structure of the given loci
-                this.deselect({ loci: Structure.toStructureElementLoci(normalized.loci.structure), repr: normalized.repr }, false);
+                this.mark({ loci: Structure.Loci(normalized.loci.structure), repr: normalized.repr }, MarkerAction.Deselect);
                 this.sel.modify('set', normalized.loci);
             }
             this.mark(normalized, MarkerAction.Select);