Browse Source

fix order in LociMarkManager.normalizedLoci

Alexander Rose 5 years ago
parent
commit
f57e8501c4
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/mol-plugin/util/interactivity.ts

+ 4 - 3
src/mol-plugin/util/interactivity.ts

@@ -97,9 +97,6 @@ namespace Interactivity {
                 // convert Link.Loci to a StructureElement.Loci so granularity can be applied
                 loci = Link.toStructureElementLoci(loci)
             }
-            if (applyGranularity) {
-                loci = Granularity[this.props.granularity](loci)
-            }
             if (Structure.isLoci(loci)) {
                 // convert to StructureElement.Loci
                 loci = Structure.toStructureElementLoci(loci)
@@ -108,6 +105,10 @@ namespace Interactivity {
                 // ensure the root structure is used
                 loci = StructureElement.Loci.remap(loci, loci.structure.root)
             }
+            if (applyGranularity) {
+                // needs to be applied AFTER remapping to root
+                loci = Granularity[this.props.granularity](loci)
+            }
             return { loci, repr }
         }