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

use repr.state.syncManually in canvas3d

parent 6359f3a8
No related branches found
No related tags found
No related merge requests found
...@@ -318,7 +318,9 @@ namespace Canvas3D { ...@@ -318,7 +318,9 @@ namespace Canvas3D {
add: (repr: Representation.Any) => { add: (repr: Representation.Any) => {
add(repr) 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) => { remove: (repr: Representation.Any) => {
const updatedSubscription = reprUpdatedSubscriptions.get(repr) const updatedSubscription = reprUpdatedSubscriptions.get(repr)
......
...@@ -161,7 +161,7 @@ export const UpdateTrajectory = StateAction.create<PluginStateObject.Root, void, ...@@ -161,7 +161,7 @@ export const UpdateTrajectory = StateAction.create<PluginStateObject.Root, void,
if (params.action === 'reset') { if (params.action === 'reset') {
for (const m of models) { for (const m of models) {
update.to(m.transform.ref).update(StateTransforms.Model.ModelFromTrajectory, update.to(m.transform.ref).update(StateTransforms.Model.ModelFromTrajectory,
() => ({ modelIndex: 0})); () => ({ modelIndex: 0 }));
} }
} else { } else {
for (const m of models) { for (const m of models) {
......
...@@ -102,7 +102,7 @@ export function UnitsRepresentation<P extends UnitsParams>(label: string, ctx: R ...@@ -102,7 +102,7 @@ export function UnitsRepresentation<P extends UnitsParams>(label: string, ctx: R
// }) // })
// unusedVisuals.forEach(visual => visual.destroy()) // unusedVisuals.forEach(visual => visual.destroy())
} else if (structure && structure !== _structure && Structure.areEquivalent(structure, _structure)) { } 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, // Expects that for structures with the same hashCode,
// the unitSymmetryGroups are the same as well. // the unitSymmetryGroups are the same as well.
// Re-uses existing visuals for the groups of the new structure. // Re-uses existing visuals for the groups of the new structure.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment