Skip to content

Commit

Permalink
Update the values when the PhET-iO state is set, see phetsims/energy-…
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Jan 15, 2025
1 parent fce7596 commit d091ff1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions js/BarNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import deprecationWarning from '../../phet-core/js/deprecationWarning.js';
import merge from '../../phet-core/js/merge.js';
import ArrowNode from '../../scenery-phet/js/ArrowNode.js';
import { Node, Rectangle } from '../../scenery/js/imports.js';
import phetioStateSetEmitter from '../../tandem/js/phetioStateSetEmitter.js';
import griddle from './griddle.js';

/**
Expand Down Expand Up @@ -113,6 +114,9 @@ class BarNode extends Node {
this.mutate( options );

this.update();

// Update the values when the PhET-iO state is set, see https://github.com/phetsims/energy-skate-park/issues/385
phetioStateSetEmitter.addListener( () => this.update() );
}

/**
Expand Down

0 comments on commit d091ff1

Please sign in to comment.