Skip to content

Commit 74fd042

Browse files
committed
If the Mouse was over a Sprite and you then clicked it, it would dispatch another Over event. This is now surpressed if the Over event has already been dispatched previously (thanks @McFarts phaserjs#2133)
InputHandler.pointerOver could fail to return anything in some instances, now always returns a boolean.
1 parent 83a35e4 commit 74fd042

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,8 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
376376
* Group.add and Group.addAt would forget to remove the child from the hash of its previous Group if it had a physics body enabled, causing unbounded hash increase (thanks @strawlion @McIntozh #2232)
377377
* Fixed a really nasty bug in Chrome OS X where a ctrl + click (i.e. simulated right-click) on a trackpad would lock up the Pointer leftButton, causing future clicks to fail. This is now handled by way of a mouseout listener on the window object, sadly the only way to force a mouseup in Chrome (thanks @KyleU #2286)
378378
* ctrl + click is now only considered a right-click if event.buttons = 1, this should allow you to use ctrl as a key modifier on Windows (and any device with a multi-button mouse attached) and still use ctrl + click on OS X / trackpads for a right-click (thanks @yuvalsv #2167)
379+
* If the Mouse was over a Sprite and you then clicked it, it would dispatch another Over event. This is now surpressed if the Over event has already been dispatched previously (thanks @McFarts #2133)
380+
* InputHandler.pointerOver could fail to return anything in some instances, now always returns a boolean.
379381

380382
### Pixi Updates
381383

src/input/InputHandler.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,8 @@ Phaser.InputHandler.prototype = {
579579
return true;
580580
}
581581
}
582+
583+
return false;
582584
}
583585
else
584586
{
@@ -868,6 +870,8 @@ Phaser.InputHandler.prototype = {
868870

869871
if (data.isOver === false || pointer.dirty)
870872
{
873+
var sendEvent = (data.isOver === false);
874+
871875
data.isOver = true;
872876
data.isOut = false;
873877
data.timeOver = this.game.time.time;
@@ -880,7 +884,7 @@ Phaser.InputHandler.prototype = {
880884
this._setHandCursor = true;
881885
}
882886

883-
if (this.sprite && this.sprite.events)
887+
if (sendEvent && this.sprite && this.sprite.events)
884888
{
885889
this.sprite.events.onInputOver$dispatch(this.sprite, pointer);
886890
}

0 commit comments

Comments
 (0)