Skip to content

Commit 1873871

Browse files
committed
Fix checkPointerDown method
checkPointerDown method was a verbatim duplication of checkPointerOver - added pointer.isDown check to passed pointer and altered wording of associated docs to make it clearer what the method is doing.
1 parent 8436bfe commit 1873871

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/input/InputHandler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,14 +610,14 @@ Phaser.InputHandler.prototype = {
610610
},
611611

612612
/**
613-
* Checks if the given pointer is over this Sprite and can click it.
613+
* Checks if the given pointer is both down and over this Sprite.
614614
* @method Phaser.InputHandler#checkPointerDown
615615
* @param {Phaser.Pointer} pointer
616616
* @return {boolean} True if the pointer is down, otherwise false.
617617
*/
618618
checkPointerDown: function (pointer) {
619619

620-
if (!this.enabled || !this.sprite || !this.sprite.parent || !this.sprite.visible || !this.sprite.parent.visible)
620+
if (!pointer.isDown || !this.enabled || !this.sprite || !this.sprite.parent || !this.sprite.visible || !this.sprite.parent.visible)
621621
{
622622
return false;
623623
}

0 commit comments

Comments
 (0)