From f4494c2195c966ed53e7834b0b36d67e840c8d53 Mon Sep 17 00:00:00 2001 From: Jonathan Olson Date: Thu, 30 Sep 2021 10:04:29 -0600 Subject: [PATCH] Fixing movement ratio for https://github.com/phetsims/molecule-shapes/issues/180 --- js/common/model/PairGroup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/common/model/PairGroup.js b/js/common/model/PairGroup.js index c933415..9a4dead 100644 --- a/js/common/model/PairGroup.js +++ b/js/common/model/PairGroup.js @@ -115,7 +115,7 @@ class PairGroup { const offset = idealDistanceFromCenter - distance; // just modify position for now so we don't get any oscillations - let ratioOfMovement = Math.pow( 0.1, 0.016 / timeElapsed ); // scale this exponentially by how much time has elapsed, so the more time taken, the faster we move towards the ideal distance + let ratioOfMovement = Math.min( 0.1 * timeElapsed / 0.016, 1 ); if ( isTerminalLonePair ) { ratioOfMovement = 1; }