Skip to content

Commit

Permalink
check in scope for state based on Tandem, phetsims/tandem#193 #338
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Aug 19, 2020
1 parent 7fdd79f commit ba4746a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/common/model/MultipleParticleModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,10 @@ class MultipleParticleModel extends PhetioObject {
);

// perform any phet-io-specific state setting actions
Tandem.PHET_IO_ENABLED && phet.phetio.phetioEngine.phetioStateEngine.stateSetEmitter.addListener( ( state, isInScope ) => {
Tandem.PHET_IO_ENABLED && phet.phetio.phetioEngine.phetioStateEngine.stateSetEmitter.addListener( ( state, scopeTandem ) => {

// State can be set on a subset of a PhET-iO sim (like a screen), so make sure that this callback applies to this instance.
if ( isInScope( this.tandem ) ) {
if ( this.tandem.hasAncestor( scopeTandem ) ) {

// make sure that we have the right number of scaled (i.e. non-normalized) atoms
const numberOfNormalizedMolecules = this.moleculeDataSet.numberOfMolecules;
Expand Down

0 comments on commit ba4746a

Please sign in to comment.