Skip to content

Commit 923a10e

Browse files
committed
Input no longer sets cursor to default if already set to none
1 parent 167a498 commit 923a10e

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ Updates:
101101
* Lots of documentation fixes in the Tween class.
102102
* Tweens fire an onLoop event if they are set to repeat. onComplete is now only fired for the final repeat (or never if the repeat is infinite)
103103
* Pointer used to un-pause a paused game every time it was clicked/touched (this avoided some rogue browser plugins). Now only happens if Stage.disableVisibilityChange is true.
104+
* Input doesn't set the cursor to default if it's already set to none.
104105

105106

106107
Bug Fixes:

src/input/Input.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,11 @@ Phaser.Input.prototype = {
488488
}
489489

490490
this.currentPointers = 0;
491-
this.game.stage.canvas.style.cursor = "default";
491+
492+
if (this.game.canvas.style.cursor !== 'none')
493+
{
494+
this.game.canvas.style.cursor = 'default';
495+
}
492496

493497
if (hard === true)
494498
{

src/input/InputHandler.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ Phaser.InputHandler.prototype = {
584584

585585
if (this.useHandCursor && this._pointerData[pointer.id].isDragged === false)
586586
{
587-
this.game.stage.canvas.style.cursor = "pointer";
587+
this.game.canvas.style.cursor = "pointer";
588588
}
589589

590590
this.sprite.events.onInputOver.dispatch(this.sprite, pointer);
@@ -605,7 +605,7 @@ Phaser.InputHandler.prototype = {
605605

606606
if (this.useHandCursor && this._pointerData[pointer.id].isDragged === false)
607607
{
608-
this.game.stage.canvas.style.cursor = "default";
608+
this.game.canvas.style.cursor = "default";
609609
}
610610

611611
if (this.sprite && this.sprite.events)
@@ -674,7 +674,7 @@ Phaser.InputHandler.prototype = {
674674
// Pointer outside the sprite? Reset the cursor
675675
if (this.useHandCursor)
676676
{
677-
this.game.stage.canvas.style.cursor = "default";
677+
this.game.canvas.style.cursor = "default";
678678
}
679679
}
680680

0 commit comments

Comments
 (0)