Skip to content

Commit f851cad

Browse files
authored
Merge pull request goldfire#1369 from alvov/issue1368
Fix: fading never resolves in some cases (fixes goldfire#1368)
2 parents 979317c + fa7bc9d commit f851cad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/howler.core.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,16 +1362,16 @@
13621362
lastTick = Date.now();
13631363
vol += diff * tick;
13641364

1365+
// Round to within 2 decimal points.
1366+
vol = Math.round(vol * 100) / 100;
1367+
13651368
// Make sure the volume is in the right bounds.
13661369
if (diff < 0) {
13671370
vol = Math.max(to, vol);
13681371
} else {
13691372
vol = Math.min(to, vol);
13701373
}
13711374

1372-
// Round to within 2 decimal points.
1373-
vol = Math.round(vol * 100) / 100;
1374-
13751375
// Change the volume.
13761376
if (self._webAudio) {
13771377
sound._volume = vol;

0 commit comments

Comments
 (0)