Skip to content

Commit

Permalink
#85 fixed time gains by clicking the step forward button
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-zelenkov committed Jun 27, 2015
1 parent b5f2506 commit 30bb520
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions js/common/model/PendulumLabModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,18 @@ define( function( require ) {
step: function( dt ) {
dt = Math.min( 0.05, dt * this.timeSpeed );

if ( (this.stopwatch.isRunning && this.play) || this.stepManualMode ) {
this.stopwatch.elapsedTime += dt;
}

if ( this.periodTimer && ((this.periodTimer.isCalculate && this.play) || this.stepManualMode) ) {
this.periodTimer.elapsedTime += dt;
}

if ( this.play || this.stepManualMode ) {
var currentPendulum;
var oldAlpha;

if ( this.stopwatch.isRunning ) {
this.stopwatch.elapsedTime += dt;
}

if ( this.periodTimer && this.periodTimer.isCalculate ) {
this.periodTimer.elapsedTime += dt;
}

for ( var i = 0; i < this.numberOfPendulums; i++ ) {
currentPendulum = this.pendulums[ i ];

Expand Down

0 comments on commit 30bb520

Please sign in to comment.