Skip to content

Commit a2854d2

Browse files
committed
Merge pull request phaserjs#1580 from integricho/fix#1551
fix phaserjs#1551 - detect mouseup on tilesprites
2 parents 41d9a42 + b52b765 commit a2854d2

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/input/Input.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -844,10 +844,10 @@ Phaser.Input.prototype = {
844844
{
845845
return (displayObject.hitArea.contains(this._localPoint.x, this._localPoint.y));
846846
}
847-
else if (displayObject instanceof PIXI.Sprite)
847+
else if (displayObject instanceof Phaser.TileSprite)
848848
{
849-
var width = displayObject.texture.frame.width;
850-
var height = displayObject.texture.frame.height;
849+
var width = displayObject.width;
850+
var height = displayObject.height;
851851
var x1 = -width * displayObject.anchor.x;
852852

853853
if (this._localPoint.x >= x1 && this._localPoint.x < x1 + width)
@@ -860,10 +860,10 @@ Phaser.Input.prototype = {
860860
}
861861
}
862862
}
863-
else if (displayObject instanceof Phaser.TileSprite)
863+
else if (displayObject instanceof PIXI.Sprite)
864864
{
865-
var width = displayObject.width;
866-
var height = displayObject.height;
865+
var width = displayObject.texture.frame.width;
866+
var height = displayObject.texture.frame.height;
867867
var x1 = -width * displayObject.anchor.x;
868868

869869
if (this._localPoint.x >= x1 && this._localPoint.x < x1 + width)

0 commit comments

Comments
 (0)