Skip to content

Commit

Permalink
Merge pull request #1369 from alvov/issue1368
Browse files Browse the repository at this point in the history
Fix: fading never resolves in some cases (fixes #1368)
  • Loading branch information
goldfire authored Oct 24, 2020
2 parents 979317c + fa7bc9d commit f851cad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/howler.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1362,16 +1362,16 @@
lastTick = Date.now();
vol += diff * tick;

// Round to within 2 decimal points.
vol = Math.round(vol * 100) / 100;

// Make sure the volume is in the right bounds.
if (diff < 0) {
vol = Math.max(to, vol);
} else {
vol = Math.min(to, vol);
}

// Round to within 2 decimal points.
vol = Math.round(vol * 100) / 100;

// Change the volume.
if (self._webAudio) {
sound._volume = vol;
Expand Down

0 comments on commit f851cad

Please sign in to comment.