Fixed rollover issue with mouse
This commit is contained in:
parent
1f67673793
commit
228fa97b16
3 changed files with 26 additions and 4 deletions
|
@ -2941,6 +2941,8 @@ PIXI.InteractionManager.prototype.update = function()
|
|||
|
||||
this.interactionDOMElement.style.cursor = 'inherit';
|
||||
|
||||
var over = false;
|
||||
|
||||
for (i = 0; i < length; i++)
|
||||
{
|
||||
var item = this.interactiveItems[i];
|
||||
|
@ -2953,6 +2955,7 @@ PIXI.InteractionManager.prototype.update = function()
|
|||
// hit-test the clip!
|
||||
|
||||
|
||||
|
||||
if(item.mouseover || item.mouseout || item.buttonMode)
|
||||
{
|
||||
// ok so there are some functions so lets hit test it..
|
||||
|
@ -2960,16 +2963,24 @@ PIXI.InteractionManager.prototype.update = function()
|
|||
this.mouse.target = item;
|
||||
// ok so deal with interactions..
|
||||
// looks like there was a hit!
|
||||
if(item.__hit)
|
||||
if(item.__hit && !over)
|
||||
{
|
||||
if(item.buttonMode) this.interactionDOMElement.style.cursor = item.defaultCursor;
|
||||
|
||||
if(!item.interactiveChildren)over = true;
|
||||
|
||||
if(!item.__isOver)
|
||||
{
|
||||
|
||||
if(item.mouseover)item.mouseover(this.mouse);
|
||||
item.__isOver = true;
|
||||
|
||||
// just the one!
|
||||
//break;
|
||||
|
||||
|
||||
}
|
||||
//break;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -222,6 +222,8 @@ PIXI.InteractionManager.prototype.update = function()
|
|||
|
||||
this.interactionDOMElement.style.cursor = 'inherit';
|
||||
|
||||
var over = false;
|
||||
|
||||
for (i = 0; i < length; i++)
|
||||
{
|
||||
var item = this.interactiveItems[i];
|
||||
|
@ -234,6 +236,7 @@ PIXI.InteractionManager.prototype.update = function()
|
|||
// hit-test the clip!
|
||||
|
||||
|
||||
|
||||
if(item.mouseover || item.mouseout || item.buttonMode)
|
||||
{
|
||||
// ok so there are some functions so lets hit test it..
|
||||
|
@ -241,16 +244,24 @@ PIXI.InteractionManager.prototype.update = function()
|
|||
this.mouse.target = item;
|
||||
// ok so deal with interactions..
|
||||
// looks like there was a hit!
|
||||
if(item.__hit)
|
||||
if(item.__hit && !over)
|
||||
{
|
||||
if(item.buttonMode) this.interactionDOMElement.style.cursor = item.defaultCursor;
|
||||
|
||||
if(!item.interactiveChildren)over = true;
|
||||
|
||||
if(!item.__isOver)
|
||||
{
|
||||
|
||||
if(item.mouseover)item.mouseover(this.mouse);
|
||||
item.__isOver = true;
|
||||
|
||||
// just the one!
|
||||
//break;
|
||||
|
||||
|
||||
}
|
||||
//break;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue