mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 20:53:39 +00:00
Pointer.up
and Pointer.down
now use a hasOwnProperty
check for the existance of the buttons property on the event, causing it to be set even if equal to zero, which it is when there are no buttons down
This commit is contained in:
parent
f8f81a06f0
commit
8111d8062e
2 changed files with 4 additions and 2 deletions
|
@ -359,6 +359,8 @@ one set of bindings ever created, which makes things a lot cleaner.
|
|||
* Arcade Physics now manages when `postUpdate` should be applied better, stopping it from gaining a zero delta during a further check in the same frame. This fixes various issues, including the mass collision test demo. Fix #4154 (thanks @samme)
|
||||
* Arcade Physics could trigger a `collide` event on a Body even if it performing an overlap check, if the `onCollide` property was true (thanks @samme)
|
||||
* TileSprites no longer cause a crash when using the Headless mode renderer. Fix #4297 (thanks @clesquir)
|
||||
* The WebGLRenderer will now apply a transparent background if `transparent = true` in the game config (thanks @gomachan7)
|
||||
* `Pointer.up` and `Pointer.down` now use a `hasOwnProperty` check for the existance of the buttons property on the event, causing it to be set even if equal to zero, which it is when there are no buttons down (thanks @SonnyCampbell)
|
||||
|
||||
### Examples and TypeScript
|
||||
|
||||
|
|
|
@ -567,7 +567,7 @@ var Pointer = new Class({
|
|||
*/
|
||||
up: function (event, time)
|
||||
{
|
||||
if (event.buttons)
|
||||
if (event.hasOwnProperty('buttons'))
|
||||
{
|
||||
this.buttons = event.buttons;
|
||||
}
|
||||
|
@ -608,7 +608,7 @@ var Pointer = new Class({
|
|||
*/
|
||||
down: function (event, time)
|
||||
{
|
||||
if (event.buttons)
|
||||
if (event.hasOwnProperty('buttons'))
|
||||
{
|
||||
this.buttons = event.buttons;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue