Skip to content

Commit

Permalink
Removed extra constructor parameter, see #317
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Sep 5, 2017
1 parent 1dab37b commit 0d3430a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions js/view/AmmeterNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@ define( function( require ) {

/**
* @param {Ammeter} ammeter
* @param {Circuit|null} circuit - to observe changes in the Circuit, or null if rendering an icon
* @param {CircuitLayerNode|null} circuitLayerNode - for getting the currents, or null if rendering an icon
* @param {Tandem} tandem // TODO: prune parameters
* @param {Tandem} tandem
* @param {Object} [options]
* @constructor
*/
function AmmeterNode( ammeter, circuit, circuitLayerNode, tandem, options ) {
function AmmeterNode( ammeter, circuitLayerNode, tandem, options ) {
var self = this;
this.circuitLayerNode = circuitLayerNode;
options = _.extend( {
Expand Down Expand Up @@ -182,7 +181,7 @@ define( function( require ) {
ammeter.currentProperty.set( current );
}
};
circuit.circuitChangedEmitter.addListener( updateAmmeter );
circuitLayerNode.circuit.circuitChangedEmitter.addListener( updateAmmeter );
ammeter.probePositionProperty.link( updateAmmeter );
}
}
Expand Down
2 changes: 1 addition & 1 deletion js/view/CircuitConstructionKitScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ define( function( require ) {
}
} );

var ammeterNode = new AmmeterNode( model.ammeter, model.circuit, this.circuitLayerNode, tandem.createTandem( 'ammeterNode' ), {
var ammeterNode = new AmmeterNode( model.ammeter, this.circuitLayerNode, tandem.createTandem( 'ammeterNode' ), {
showResultsProperty: model.isValueDepictionEnabledProperty,
visibleBoundsProperty: this.circuitLayerNode.visibleBoundsInCircuitCoordinateFrameProperty,
blackBoxStudy: options.blackBoxStudy
Expand Down
2 changes: 1 addition & 1 deletion js/view/SensorToolbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ define( function( require ) {

// Icon for the ammeter
var ammeter = new Ammeter( tandem.createTandem( 'ammeterIconModel' ) );
var ammeterNodeIcon = new AmmeterNode( ammeter, null, null, tandem.createTandem( 'ammeterNodeIcon' ), { icon: true } );
var ammeterNodeIcon = new AmmeterNode( ammeter, null, tandem.createTandem( 'ammeterNodeIcon' ), { icon: true } );
ammeterNode.ammeter.visibleProperty.link( function( visible ) { ammeterNodeIcon.visible = !visible; } );
ammeterNodeIcon.mutate( { scale: TOOLBOX_ICON_SIZE / Math.max( ammeterNodeIcon.width, ammeterNodeIcon.height ) } );
ammeterNodeIcon.addInputListener( createListener( ammeterNode.ammeter, ammeterNode ) );
Expand Down

0 comments on commit 0d3430a

Please sign in to comment.