diff --git a/README.md b/README.md index 614e61bd..5b7ad409 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,7 @@ Updates: * Lots of documentation fixes in the Tween class. * 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) * 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. +* Input doesn't set the cursor to default if it's already set to none. Bug Fixes: diff --git a/src/input/Input.js b/src/input/Input.js index 42d3c0ef..aac7f365 100644 --- a/src/input/Input.js +++ b/src/input/Input.js @@ -488,7 +488,11 @@ Phaser.Input.prototype = { } this.currentPointers = 0; - this.game.stage.canvas.style.cursor = "default"; + + if (this.game.canvas.style.cursor !== 'none') + { + this.game.canvas.style.cursor = 'default'; + } if (hard === true) { diff --git a/src/input/InputHandler.js b/src/input/InputHandler.js index 1d13daa6..100ebb1d 100644 --- a/src/input/InputHandler.js +++ b/src/input/InputHandler.js @@ -584,7 +584,7 @@ Phaser.InputHandler.prototype = { if (this.useHandCursor && this._pointerData[pointer.id].isDragged === false) { - this.game.stage.canvas.style.cursor = "pointer"; + this.game.canvas.style.cursor = "pointer"; } this.sprite.events.onInputOver.dispatch(this.sprite, pointer); @@ -605,7 +605,7 @@ Phaser.InputHandler.prototype = { if (this.useHandCursor && this._pointerData[pointer.id].isDragged === false) { - this.game.stage.canvas.style.cursor = "default"; + this.game.canvas.style.cursor = "default"; } if (this.sprite && this.sprite.events) @@ -674,7 +674,7 @@ Phaser.InputHandler.prototype = { // Pointer outside the sprite? Reset the cursor if (this.useHandCursor) { - this.game.stage.canvas.style.cursor = "default"; + this.game.canvas.style.cursor = "default"; } }