Skip to content

Commit

Permalink
Support fades with 2+ decimal places
Browse files Browse the repository at this point in the history
Fixes #696
  • Loading branch information
goldfire committed Mar 10, 2017
1 parent 32118b6 commit 7224cd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/howler.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1135,10 +1135,10 @@
}

// When the fade is complete, stop it and fire event.
if (vol === to) {
if ((to < from && vol <= to) || (to > from && vol >= to)) {
clearInterval(sound._interval);
sound._interval = null;
self.volume(vol, soundId);
self.volume(to, soundId);
self._emit('fade', soundId);
}
}.bind(self, ids[i], sound), stepLen);
Expand Down

0 comments on commit 7224cd5

Please sign in to comment.