Skip to content

Commit 4d587d3

Browse files
committed
Fixed issue with not removing mouseoutglobal eventlistener
1 parent ad6f055 commit 4d587d3

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/input/Mouse.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
* The Mouse class is responsible for handling all aspects of mouse interaction with the browser.
99
*
1010
* It captures and processes mouse events that happen on the game canvas object.
11-
* It also adds a single `mouseup` listener to `window` which is used to capture the mouse being released
11+
* It also adds a single `mouseup` listener to `window` which is used to capture the mouse being released
1212
* when not over the game.
1313
*
14-
* You should not normally access this class directly, but instead use a Phaser.Pointer object
14+
* You should not normally access this class directly, but instead use a Phaser.Pointer object
1515
* which normalises all game input for you, including accurate button handling.
1616
*
1717
* @class Phaser.Mouse
@@ -385,7 +385,7 @@ Phaser.Mouse.prototype = {
385385

386386
/**
387387
* The internal method that handles the mouse up event from the window.
388-
*
388+
*
389389
* @method Phaser.Mouse#onMouseUpGlobal
390390
* @param {MouseEvent} event - The native event from the browser. This gets stored in Mouse.event.
391391
*/
@@ -407,7 +407,7 @@ Phaser.Mouse.prototype = {
407407

408408
/**
409409
* The internal method that handles the mouse out event from the window.
410-
*
410+
*
411411
* @method Phaser.Mouse#onMouseOutGlobal
412412
* @param {MouseEvent} event - The native event from the browser. This gets stored in Mouse.event.
413413
*/
@@ -432,7 +432,7 @@ Phaser.Mouse.prototype = {
432432
// the browser opening a context-menu or similar.
433433
// On OS X Chrome especially this is bad news, as it blocks
434434
// us then getting a mouseup event, so we need to force that through.
435-
//
435+
//
436436
// No matter what, we must cancel the left and right buttons
437437

438438
this.input.mousePointer.stop(event);
@@ -561,7 +561,7 @@ Phaser.Mouse.prototype = {
561561

562562
/**
563563
* Internal pointerLockChange handler.
564-
*
564+
*
565565
* @method Phaser.Mouse#pointerLockChange
566566
* @param {Event} event - The native event from the browser. This gets stored in Mouse.event.
567567
*/
@@ -622,6 +622,7 @@ Phaser.Mouse.prototype = {
622622
}
623623

624624
window.removeEventListener('mouseup', this._onMouseUpGlobal, true);
625+
window.removeEventListener('mouseout', this._onMouseOutGlobal, true);
625626

626627
document.removeEventListener('pointerlockchange', this._pointerLockChange, true);
627628
document.removeEventListener('mozpointerlockchange', this._pointerLockChange, true);

0 commit comments

Comments
 (0)