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';
|
this.interactionDOMElement.style.cursor = 'inherit';
|
||||||
|
|
||||||
|
var over = false;
|
||||||
|
|
||||||
for (i = 0; i < length; i++)
|
for (i = 0; i < length; i++)
|
||||||
{
|
{
|
||||||
var item = this.interactiveItems[i];
|
var item = this.interactiveItems[i];
|
||||||
|
@ -2953,6 +2955,7 @@ PIXI.InteractionManager.prototype.update = function()
|
||||||
// hit-test the clip!
|
// hit-test the clip!
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(item.mouseover || item.mouseout || item.buttonMode)
|
if(item.mouseover || item.mouseout || item.buttonMode)
|
||||||
{
|
{
|
||||||
// ok so there are some functions so lets hit test it..
|
// ok so there are some functions so lets hit test it..
|
||||||
|
@ -2960,16 +2963,24 @@ PIXI.InteractionManager.prototype.update = function()
|
||||||
this.mouse.target = item;
|
this.mouse.target = item;
|
||||||
// ok so deal with interactions..
|
// ok so deal with interactions..
|
||||||
// looks like there was a hit!
|
// looks like there was a hit!
|
||||||
if(item.__hit)
|
if(item.__hit && !over)
|
||||||
{
|
{
|
||||||
if(item.buttonMode) this.interactionDOMElement.style.cursor = item.defaultCursor;
|
if(item.buttonMode) this.interactionDOMElement.style.cursor = item.defaultCursor;
|
||||||
|
|
||||||
|
if(!item.interactiveChildren)over = true;
|
||||||
|
|
||||||
if(!item.__isOver)
|
if(!item.__isOver)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(item.mouseover)item.mouseover(this.mouse);
|
if(item.mouseover)item.mouseover(this.mouse);
|
||||||
item.__isOver = true;
|
item.__isOver = true;
|
||||||
|
|
||||||
|
// just the one!
|
||||||
|
//break;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//break;
|
||||||
}
|
}
|
||||||
else
|
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';
|
this.interactionDOMElement.style.cursor = 'inherit';
|
||||||
|
|
||||||
|
var over = false;
|
||||||
|
|
||||||
for (i = 0; i < length; i++)
|
for (i = 0; i < length; i++)
|
||||||
{
|
{
|
||||||
var item = this.interactiveItems[i];
|
var item = this.interactiveItems[i];
|
||||||
|
@ -234,6 +236,7 @@ PIXI.InteractionManager.prototype.update = function()
|
||||||
// hit-test the clip!
|
// hit-test the clip!
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(item.mouseover || item.mouseout || item.buttonMode)
|
if(item.mouseover || item.mouseout || item.buttonMode)
|
||||||
{
|
{
|
||||||
// ok so there are some functions so lets hit test it..
|
// ok so there are some functions so lets hit test it..
|
||||||
|
@ -241,16 +244,24 @@ PIXI.InteractionManager.prototype.update = function()
|
||||||
this.mouse.target = item;
|
this.mouse.target = item;
|
||||||
// ok so deal with interactions..
|
// ok so deal with interactions..
|
||||||
// looks like there was a hit!
|
// looks like there was a hit!
|
||||||
if(item.__hit)
|
if(item.__hit && !over)
|
||||||
{
|
{
|
||||||
if(item.buttonMode) this.interactionDOMElement.style.cursor = item.defaultCursor;
|
if(item.buttonMode) this.interactionDOMElement.style.cursor = item.defaultCursor;
|
||||||
|
|
||||||
|
if(!item.interactiveChildren)over = true;
|
||||||
|
|
||||||
if(!item.__isOver)
|
if(!item.__isOver)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(item.mouseover)item.mouseover(this.mouse);
|
if(item.mouseover)item.mouseover(this.mouse);
|
||||||
item.__isOver = true;
|
item.__isOver = true;
|
||||||
|
|
||||||
|
// just the one!
|
||||||
|
//break;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue