Sound.position can no longer become negative, meaning calls to AudioContextNode.start with negative position offsets will no longer throw errors (thanks @Weedshaker #2351)

This commit is contained in:
photonstorm 2016-02-26 13:36:19 +00:00
parent 15d952171c
commit 08ce659447
2 changed files with 2 additions and 1 deletions

View file

@ -325,6 +325,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
* TypeScript definitions fixes and updates (thanks @clark-stevenson)
* Docs typo fixes (thanks)
* Removed a console.log from the TilingSprite generator.
* Sound.position can no longer become negative, meaning calls to AudioContextNode.start with negative position offsets will no longer throw errors (thanks @Weedshaker #2351)
### Bug Fixes

View file

@ -589,7 +589,7 @@ Phaser.Sound.prototype = {
if (volume === undefined) { volume = this._volume; }
if (loop === undefined) { loop = this.loop; }
this.position = position;
this.position = Math.max(0, position);
this.volume = volume;
this.loop = loop;
this.duration = 0;