Skip to content

Commit

Permalink
Instrument "more tools" screen, see #397
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 10, 2021
1 parent f20d694 commit a5b9562
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
8 changes: 4 additions & 4 deletions js/common/view/LaserNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,12 @@ class LaserNode extends Node {
} );
isTranslationEnabledProperty.lazyLink( isEnabled => {
if ( isEnabled ) {
translationTarget.addInputListener( translationListener );
translationTarget.addInputListener( translationOverListener );
translationTarget && translationTarget.addInputListener( translationListener );
translationTarget && translationTarget.addInputListener( translationOverListener );
}
else {
translationTarget.removeInputListener( translationListener );
translationTarget.removeInputListener( translationOverListener );
translationTarget && translationTarget.removeInputListener( translationListener );
translationTarget && translationTarget.removeInputListener( translationOverListener );
}
} );

Expand Down
4 changes: 3 additions & 1 deletion js/more-tools/MoreToolsScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ class MoreToolsScreen extends Screen {

super(
() => new MoreToolsModel( tandem.createTandem( 'model' ) ),
model => new MoreToolsScreenView( model ),
model => new MoreToolsScreenView( model, {
tandem: options.tandem.createTandem( 'view' )
} ),
options
);
}
Expand Down
8 changes: 5 additions & 3 deletions js/more-tools/view/MoreToolsScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import Property from '../../../../axon/js/Property.js';
import Rectangle from '../../../../dot/js/Rectangle.js';
import Shape from '../../../../kite/js/Shape.js';
import merge from '../../../../phet-core/js/merge.js';
import MovableDragHandler from '../../../../scenery-phet/js/input/MovableDragHandler.js';
import VBox from '../../../../scenery/js/nodes/VBox.js';
import bendingLight from '../../bendingLight.js';
Expand All @@ -28,8 +29,9 @@ class MoreToolsScreenView extends IntroScreenView {

/**
* @param {MoreToolsModel} moreToolsModel - model of the more tools screen
* @param {Object} [options]
*/
constructor( moreToolsModel ) {
constructor( moreToolsModel, options ) {

super( moreToolsModel,
true, // hasMoreTools
Expand All @@ -43,10 +45,10 @@ class MoreToolsScreenView extends IntroScreenView {
new LaserTypeAquaRadioButtonGroup( model.laserViewProperty ),
new WavelengthControl( model.wavelengthProperty, new Property( true ), 120 )
]
} ), {
} ), merge( {
verticalPlayAreaOffset: 0,
horizontalPlayAreaOffset: 0
} );
}, options ) );

this.moreToolsModel = moreToolsModel; // @public (read-only)

Expand Down

0 comments on commit a5b9562

Please sign in to comment.