Skip to content

Commit

Permalink
Fix: fading never resolves in some cases (fixes #1368)
Browse files Browse the repository at this point in the history
  • Loading branch information
alvov committed Jul 6, 2020
1 parent 9117525 commit fa7bc9d
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 fa7bc9d

Please sign in to comment.