Skip to content

Commit 8111d80

Browse files
committed
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
1 parent f8f81a0 commit 8111d80

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@ one set of bindings ever created, which makes things a lot cleaner.
359359
* 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)
360360
* 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)
361361
* TileSprites no longer cause a crash when using the Headless mode renderer. Fix #4297 (thanks @clesquir)
362+
* The WebGLRenderer will now apply a transparent background if `transparent = true` in the game config (thanks @gomachan7)
363+
* `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)
362364

363365
### Examples and TypeScript
364366

src/input/Pointer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ var Pointer = new Class({
567567
*/
568568
up: function (event, time)
569569
{
570-
if (event.buttons)
570+
if (event.hasOwnProperty('buttons'))
571571
{
572572
this.buttons = event.buttons;
573573
}
@@ -608,7 +608,7 @@ var Pointer = new Class({
608608
*/
609609
down: function (event, time)
610610
{
611-
if (event.buttons)
611+
if (event.hasOwnProperty('buttons'))
612612
{
613613
this.buttons = event.buttons;
614614
}

0 commit comments

Comments
 (0)