Skip to content

Commit

Permalink
StepBackButton, StepForwardButton: remove stepFunction param, use opt…
Browse files Browse the repository at this point in the history
…ions.listener, phetsims/scenery-phet#243
  • Loading branch information
pixelzoom committed Jul 6, 2016
1 parent fb26798 commit 98b62fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
19 changes: 8 additions & 11 deletions js/flow/view/FlowView.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,21 +193,18 @@ define( function( require ) {
}
} );
// add play pause button and step button
var stepButton = new StepForwardButton(
function() {
var stepButton = new StepForwardButton( flowModel.isPlayingProperty, {
listener: function() {
flowModel.timer.step( 0.016 );
flowModel.propagateParticles( 0.016 );
flowView.pipeNode.particlesLayer.step();
},
flowModel.isPlayingProperty,
{
radius: 12,
stroke: 'black',
fill: '#005566',
right: fluidDensityControlNode.left - 82,
bottom: this.layoutBounds.bottom - 14
}
);
radius: 12,
stroke: 'black',
fill: '#005566',
right: fluidDensityControlNode.left - 82,
bottom: this.layoutBounds.bottom - 14
} );

this.addChild( stepButton );

Expand Down
5 changes: 2 additions & 3 deletions js/watertower/view/WaterTowerView.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,8 @@ define( function( require ) {
this.addChild( sluiceControlPanel );

// add play pause button and step button
var stepButton = new StepForwardButton( function() {
waterTowerModel.stepInternal( 0.016 );
}, waterTowerModel.isPlayingProperty, {
var stepButton = new StepForwardButton( waterTowerModel.isPlayingProperty, {
listener: function() { waterTowerModel.stepInternal( 0.016 ); },
stroke: 'black',
fill: '#005566',
right: fluidDensityControlSlider.left - inset,
Expand Down

0 comments on commit 98b62fd

Please sign in to comment.