Bladeren bron

use repr.state.syncManually in canvas3d

Alexander Rose 6 jaren geleden
bovenliggende
commit
ac536d2210

+ 3 - 1
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)

+ 1 - 1
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) {

+ 1 - 1
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.