phetsims / build-an-atom

"Build an Atom" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/build-an-atom
GNU General Public License v3.0
11 stars 10 forks source link

Bucket label instances are named oddly #164

Closed phet-steele closed 7 years ago

phet-steele commented 7 years ago

Here is an example for the Protons bucket on the first screen. Note that no useful information is presented in the instance name, like screen or bucket the label belongs to:

screen shot 2017-06-02 at 12 14 47 pm

The same instance from a previous version https://phet-io.colorado.edu/sims/build-an-atom/1.4.0-phetio/wrappers/instance-proxies/instance-proxies.html?sim=build-an-atom shows that the instance name was fine at one point (see #163 if the version number is confusing).

screen shot 2017-06-02 at 12 22 38 pm

Seen on Win 10 Chrome and FF. For phetsims/tasks/issues/850.

zepumph commented 7 years ago

I found the cause I think:

options = _.extend( {
      labelNode: new Text( bucket.captionText, {
        font: new PhetFont( 20 ),
        fill: bucket.captionColor,
        tandem: Tandem.tandemRequired().createTandem( 'label' )
      } )
    }, options );

This tandemRequired() call is never being overridden for default label nodes, I need to pull this labelNode out of the options.

zepumph commented 7 years ago

Alright I updated these lines and there are no more cases of 'required' in instance proxies. I will cherry pick into branches later.

phet-steele commented 7 years ago

Looks good to me, thanks.