Skip to content

Commit

Permalink
sort intensity changes after adding one at wave start, see #401
Browse files Browse the repository at this point in the history
  • Loading branch information
jbphet committed May 8, 2024
1 parent a91780e commit 89dc396
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js/waves/model/Wave.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@ class Wave extends PhetioObject {

// Create a new intensity wave to depict the change in intensity traveling with the wave.
this.intensityChanges.push( new WaveIntensityChange( this.intensityAtStart, INTENSITY_CHANGE_DISTANCE_BUMP ) );

// Make sure the intensity changes are in the correct order in the array.
this.sortIntensityChanges();
}

// Set the new intensity value at the start.
Expand Down

0 comments on commit 89dc396

Please sign in to comment.