From d48e6da62a0c9c7a9edecba36069a45d4d71d47b Mon Sep 17 00:00:00 2001 From: Jonathan Olson Date: Wed, 1 Mar 2017 12:36:31 -0700 Subject: [PATCH] Don't step the simulation back in time. See https://github.com/phetsims/joist/issues/409 --- js/Sim.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/Sim.js b/js/Sim.js index a24f2c72..1f100d36 100644 --- a/js/Sim.js +++ b/js/Sim.js @@ -693,7 +693,11 @@ define( function( require ) { // Convert to seconds var dt = elapsedTimeMilliseconds / 1000.0; - this.stepSimulation( dt ); + + // Don't run the simulation on steps back in time (see https://github.com/phetsims/joist/issues/409). + if ( dt >= 0 ) { + this.stepSimulation( dt ); + } }, /**