From ac536d2210a18ce62697f6afcb0eda745c7ce62e Mon Sep 17 00:00:00 2001 From: Alexander Rose <alex.rose@rcsb.org> Date: Wed, 21 Nov 2018 15:51:09 -0800 Subject: [PATCH] use repr.state.syncManually in canvas3d --- src/mol-canvas3d/canvas3d.ts | 4 +++- src/mol-plugin/state/actions/basic.ts | 2 +- src/mol-repr/structure/units-representation.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mol-canvas3d/canvas3d.ts b/src/mol-canvas3d/canvas3d.ts index 6cee29711..b8d7d83cf 100644 --- a/src/mol-canvas3d/canvas3d.ts +++ b/src/mol-canvas3d/canvas3d.ts @@ -318,7 +318,9 @@ namespace Canvas3D { add: (repr: Representation.Any) => { add(repr) - reprUpdatedSubscriptions.set(repr, repr.updated.subscribe(_ => add(repr))) + reprUpdatedSubscriptions.set(repr, repr.updated.subscribe(_ => { + if (!repr.state.syncManually) add(repr) + })) }, remove: (repr: Representation.Any) => { const updatedSubscription = reprUpdatedSubscriptions.get(repr) diff --git a/src/mol-plugin/state/actions/basic.ts b/src/mol-plugin/state/actions/basic.ts index 190dc4fd5..d102d1151 100644 --- a/src/mol-plugin/state/actions/basic.ts +++ b/src/mol-plugin/state/actions/basic.ts @@ -161,7 +161,7 @@ export const UpdateTrajectory = StateAction.create<PluginStateObject.Root, void, if (params.action === 'reset') { for (const m of models) { update.to(m.transform.ref).update(StateTransforms.Model.ModelFromTrajectory, - () => ({ modelIndex: 0})); + () => ({ modelIndex: 0 })); } } else { for (const m of models) { diff --git a/src/mol-repr/structure/units-representation.ts b/src/mol-repr/structure/units-representation.ts index b796a22dc..01b381c9e 100644 --- a/src/mol-repr/structure/units-representation.ts +++ b/src/mol-repr/structure/units-representation.ts @@ -102,7 +102,7 @@ export function UnitsRepresentation<P extends UnitsParams>(label: string, ctx: R // }) // unusedVisuals.forEach(visual => visual.destroy()) } else if (structure && structure !== _structure && Structure.areEquivalent(structure, _structure)) { - console.log(label, 'structures equivalent but not identical') + // console.log(label, 'structures equivalent but not identical') // Expects that for structures with the same hashCode, // the unitSymmetryGroups are the same as well. // Re-uses existing visuals for the groups of the new structure. -- GitLab