Skip to content

Commit 08ce659

Browse files
committed
Sound.position can no longer become negative, meaning calls to AudioContextNode.start with negative position offsets will no longer throw errors (thanks @Weedshaker phaserjs#2351)
1 parent 15d9521 commit 08ce659

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
325325
* TypeScript definitions fixes and updates (thanks @clark-stevenson)
326326
* Docs typo fixes (thanks)
327327
* Removed a console.log from the TilingSprite generator.
328+
* Sound.position can no longer become negative, meaning calls to AudioContextNode.start with negative position offsets will no longer throw errors (thanks @Weedshaker #2351)
328329

329330
### Bug Fixes
330331

src/sound/Sound.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ Phaser.Sound.prototype = {
589589
if (volume === undefined) { volume = this._volume; }
590590
if (loop === undefined) { loop = this.loop; }
591591

592-
this.position = position;
592+
this.position = Math.max(0, position);
593593
this.volume = volume;
594594
this.loop = loop;
595595
this.duration = 0;

0 commit comments

Comments
 (0)