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)

InputHandler.pointerOver could fail to return anything in some instances, now always returns a boolean.
This commit is contained in:
Richard Davey 2016-02-17 02:07:07 +00:00
parent 83a35e41d6
commit 74fd042749
2 changed files with 7 additions and 1 deletions

View file

@ -376,6 +376,8 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
* 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) * 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)
* 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) * 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)
* 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) * 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)
* 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)
* InputHandler.pointerOver could fail to return anything in some instances, now always returns a boolean.
### Pixi Updates ### Pixi Updates

View file

@ -579,6 +579,8 @@ Phaser.InputHandler.prototype = {
return true; return true;
} }
} }
return false;
} }
else else
{ {
@ -868,6 +870,8 @@ Phaser.InputHandler.prototype = {
if (data.isOver === false || pointer.dirty) if (data.isOver === false || pointer.dirty)
{ {
var sendEvent = (data.isOver === false);
data.isOver = true; data.isOver = true;
data.isOut = false; data.isOut = false;
data.timeOver = this.game.time.time; data.timeOver = this.game.time.time;
@ -880,7 +884,7 @@ Phaser.InputHandler.prototype = {
this._setHandCursor = true; this._setHandCursor = true;
} }
if (this.sprite && this.sprite.events) if (sendEvent && this.sprite && this.sprite.events)
{ {
this.sprite.events.onInputOver$dispatch(this.sprite, pointer); this.sprite.events.onInputOver$dispatch(this.sprite, pointer);
} }