From 69f0273dea4f905c048cc393d3d79407f4da44ea Mon Sep 17 00:00:00 2001 From: samreid Date: Wed, 12 Dec 2018 16:00:43 -0700 Subject: [PATCH] Reset timer and pause when changing scenes, see https://github.com/phetsims/wave-interference/issues/231 --- js/waves/model/WavesScreenModel.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/waves/model/WavesScreenModel.js b/js/waves/model/WavesScreenModel.js index 4453f2da..84deffdb 100644 --- a/js/waves/model/WavesScreenModel.js +++ b/js/waves/model/WavesScreenModel.js @@ -273,8 +273,11 @@ define( require => { // @public - Notifies listeners when the model reset is complete this.resetEmitter = new Emitter(); - // Reset the stopwatch time when changing scenes. - this.sceneProperty.link( () => this.timerElapsedTimeProperty.reset() ); + // Reset the stopwatch time when changing scenes, and pause it. + this.sceneProperty.link( () => { + this.isTimerRunningProperty.reset(); + this.timerElapsedTimeProperty.reset(); + } ); } /**