Skip to content
Snippets Groups Projects
Commit 2ec2d199 authored by Alexander Rose's avatar Alexander Rose
Browse files

improve StructureSelectionManager.onUpdate

- only process for root structure (processing childs is superfluous)
parent 0bc65f3b
Branches
No related tags found
No related merge requests found
...@@ -245,7 +245,6 @@ export class StructureSelectionManager extends StatefulPluginComponent<Structure ...@@ -245,7 +245,6 @@ export class StructureSelectionManager extends StatefulPluginComponent<Structure
} }
private onUpdate(ref: string, oldObj: PSO.Molecule.Structure | undefined, obj: PSO.Molecule.Structure) { private onUpdate(ref: string, oldObj: PSO.Molecule.Structure | undefined, obj: PSO.Molecule.Structure) {
// no change to structure // no change to structure
if (oldObj === obj || oldObj?.data === obj.data) return; if (oldObj === obj || oldObj?.data === obj.data) return;
...@@ -253,7 +252,9 @@ export class StructureSelectionManager extends StatefulPluginComponent<Structure ...@@ -253,7 +252,9 @@ export class StructureSelectionManager extends StatefulPluginComponent<Structure
const cell = this.plugin.helpers.substructureParent.get(obj.data, true); const cell = this.plugin.helpers.substructureParent.get(obj.data, true);
if (!cell) return; if (!cell) return;
ref = cell.transform.ref; // only need to update the root
if (ref !== cell.transform.ref) return;
if (!this.entries.has(ref)) return; if (!this.entries.has(ref)) return;
// use structure from last decorator as reference // use structure from last decorator as reference
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment