diff --git a/src/mol-plugin/behavior/dynamic/selection/structure-representation-interaction.ts b/src/mol-plugin/behavior/dynamic/selection/structure-representation-interaction.ts index 58e46320e30095c1d84c02d9f90597bf4f582051..b26cab5f0bf5ebe19cd202986626b95595a465eb 100644 --- a/src/mol-plugin/behavior/dynamic/selection/structure-representation-interaction.ts +++ b/src/mol-plugin/behavior/dynamic/selection/structure-representation-interaction.ts @@ -102,13 +102,14 @@ export class StructureRepresentationInteractionBehavior extends PluginBehavior.W if (groups.length === 0) return; const update = state.build(); + const bundle = StructureElement.Bundle.Empty; const expression = MS.struct.generator.empty(); for (const g of groups) { // TODO: update props of the group node to ghost const res = StateSelection.findTagInSubtree(state.tree, g.transform.ref, Tags.ResidueSel); const surr = StateSelection.findTagInSubtree(state.tree, g.transform.ref, Tags.SurrSel); - if (res) update.to(res).update(StateTransforms.Model.StructureSelectionFromExpression, old => ({ ...old, expression })); + if (res) update.to(res).update(StateTransforms.Model.StructureSelectionFromBundle, old => ({ ...old, bundle })); if (surr) update.to(surr).update(StateTransforms.Model.StructureSelectionFromExpression, old => ({ ...old, expression })); } @@ -166,7 +167,7 @@ export class StructureRepresentationInteractionBehavior extends PluginBehavior.W lastLoci = loci; - const residueLoci = StructureElement.Loci.extendToWholeResidues(loci) + const residueLoci = StructureElement.Loci.extendToWholeResidues(StructureElement.Loci.remap(loci, parent.obj!.data)) const residueBundle = StructureElement.Bundle.fromLoci(residueLoci) const surroundings = MS.struct.modifier.includeSurroundings({