Tweaked mouse up interaction to work inline with expectations
commented out unused {}
This commit is contained in:
parent
141083e8d2
commit
cef2ceb286
3 changed files with 95 additions and 95 deletions
|
@ -2964,41 +2964,41 @@ PIXI.InteractionManager.prototype.update = function()
|
||||||
// OK so.. does the object have any other interactive functions?
|
// OK so.. does the object have any other interactive functions?
|
||||||
// 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..
|
||||||
|
item.__hit = this.hitTest(item, this.mouse);
|
||||||
|
this.mouse.target = item;
|
||||||
|
// ok so deal with interactions..
|
||||||
|
// looks like there was a hit!
|
||||||
|
if(item.__hit && !over)
|
||||||
{
|
{
|
||||||
// ok so there are some functions so lets hit test it..
|
if(item.buttonMode) this.interactionDOMElement.style.cursor = item.defaultCursor;
|
||||||
item.__hit = this.hitTest(item, this.mouse);
|
|
||||||
this.mouse.target = item;
|
if(!item.interactiveChildren)over = true;
|
||||||
// ok so deal with interactions..
|
|
||||||
// looks like there was a hit!
|
if(!item.__isOver)
|
||||||
if(item.__hit && !over)
|
|
||||||
{
|
{
|
||||||
if(item.buttonMode) this.interactionDOMElement.style.cursor = item.defaultCursor;
|
|
||||||
|
|
||||||
if(!item.interactiveChildren)over = true;
|
if(item.mouseover)item.mouseover(this.mouse);
|
||||||
|
item.__isOver = true;
|
||||||
|
|
||||||
if(!item.__isOver)
|
// just the one!
|
||||||
{
|
|
||||||
|
|
||||||
if(item.mouseover)item.mouseover(this.mouse);
|
|
||||||
item.__isOver = true;
|
|
||||||
|
|
||||||
// just the one!
|
|
||||||
//break;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
//break;
|
//break;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
//break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(item.__isOver)
|
||||||
{
|
{
|
||||||
if(item.__isOver)
|
// roll out!
|
||||||
{
|
if(item.mouseout)item.mouseout(this.mouse);
|
||||||
// roll out!
|
item.__isOver = false;
|
||||||
if(item.mouseout)item.mouseout(this.mouse);
|
|
||||||
item.__isOver = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
// --->
|
// --->
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -3112,34 +3112,34 @@ PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
||||||
{
|
{
|
||||||
var item = this.interactiveItems[i];
|
var item = this.interactiveItems[i];
|
||||||
|
|
||||||
if(item.mouseup || item.mouseupoutside || item.click)
|
//if(item.mouseup || item.mouseupoutside || item.click)
|
||||||
|
//{
|
||||||
|
item.__hit = this.hitTest(item, this.mouse);
|
||||||
|
|
||||||
|
if(item.__hit && !up)
|
||||||
{
|
{
|
||||||
item.__hit = this.hitTest(item, this.mouse);
|
//call the function!
|
||||||
|
if(item.mouseup)
|
||||||
if(item.__hit && !up)
|
|
||||||
{
|
{
|
||||||
//call the function!
|
item.mouseup(this.mouse);
|
||||||
if(item.mouseup)
|
|
||||||
{
|
|
||||||
item.mouseup(this.mouse);
|
|
||||||
}
|
|
||||||
if(item.__isDown)
|
|
||||||
{
|
|
||||||
if(item.click)item.click(this.mouse);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!item.interactiveChildren)up = true;
|
|
||||||
}
|
}
|
||||||
else
|
if(item.__isDown)
|
||||||
{
|
{
|
||||||
if(item.__isDown)
|
if(item.click)item.click(this.mouse);
|
||||||
{
|
|
||||||
if(item.mouseupoutside)item.mouseupoutside(this.mouse);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
item.__isDown = false;
|
if(!item.interactiveChildren)up = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(item.__isDown)
|
||||||
|
{
|
||||||
|
if(item.mouseupoutside)item.mouseupoutside(this.mouse);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
item.__isDown = false;
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -235,41 +235,41 @@ PIXI.InteractionManager.prototype.update = function()
|
||||||
// OK so.. does the object have any other interactive functions?
|
// OK so.. does the object have any other interactive functions?
|
||||||
// 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..
|
||||||
|
item.__hit = this.hitTest(item, this.mouse);
|
||||||
|
this.mouse.target = item;
|
||||||
|
// ok so deal with interactions..
|
||||||
|
// looks like there was a hit!
|
||||||
|
if(item.__hit && !over)
|
||||||
{
|
{
|
||||||
// ok so there are some functions so lets hit test it..
|
if(item.buttonMode) this.interactionDOMElement.style.cursor = item.defaultCursor;
|
||||||
item.__hit = this.hitTest(item, this.mouse);
|
|
||||||
this.mouse.target = item;
|
if(!item.interactiveChildren)over = true;
|
||||||
// ok so deal with interactions..
|
|
||||||
// looks like there was a hit!
|
if(!item.__isOver)
|
||||||
if(item.__hit && !over)
|
|
||||||
{
|
{
|
||||||
if(item.buttonMode) this.interactionDOMElement.style.cursor = item.defaultCursor;
|
|
||||||
|
|
||||||
if(!item.interactiveChildren)over = true;
|
if(item.mouseover)item.mouseover(this.mouse);
|
||||||
|
item.__isOver = true;
|
||||||
|
|
||||||
if(!item.__isOver)
|
// just the one!
|
||||||
{
|
|
||||||
|
|
||||||
if(item.mouseover)item.mouseover(this.mouse);
|
|
||||||
item.__isOver = true;
|
|
||||||
|
|
||||||
// just the one!
|
|
||||||
//break;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
//break;
|
//break;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
//break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(item.__isOver)
|
||||||
{
|
{
|
||||||
if(item.__isOver)
|
// roll out!
|
||||||
{
|
if(item.mouseout)item.mouseout(this.mouse);
|
||||||
// roll out!
|
item.__isOver = false;
|
||||||
if(item.mouseout)item.mouseout(this.mouse);
|
|
||||||
item.__isOver = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
// --->
|
// --->
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -383,34 +383,34 @@ PIXI.InteractionManager.prototype.onMouseUp = function(event)
|
||||||
{
|
{
|
||||||
var item = this.interactiveItems[i];
|
var item = this.interactiveItems[i];
|
||||||
|
|
||||||
if(item.mouseup || item.mouseupoutside || item.click)
|
//if(item.mouseup || item.mouseupoutside || item.click)
|
||||||
|
//{
|
||||||
|
item.__hit = this.hitTest(item, this.mouse);
|
||||||
|
|
||||||
|
if(item.__hit && !up)
|
||||||
{
|
{
|
||||||
item.__hit = this.hitTest(item, this.mouse);
|
//call the function!
|
||||||
|
if(item.mouseup)
|
||||||
if(item.__hit && !up)
|
|
||||||
{
|
{
|
||||||
//call the function!
|
item.mouseup(this.mouse);
|
||||||
if(item.mouseup)
|
|
||||||
{
|
|
||||||
item.mouseup(this.mouse);
|
|
||||||
}
|
|
||||||
if(item.__isDown)
|
|
||||||
{
|
|
||||||
if(item.click)item.click(this.mouse);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!item.interactiveChildren)up = true;
|
|
||||||
}
|
}
|
||||||
else
|
if(item.__isDown)
|
||||||
{
|
{
|
||||||
if(item.__isDown)
|
if(item.click)item.click(this.mouse);
|
||||||
{
|
|
||||||
if(item.mouseupoutside)item.mouseupoutside(this.mouse);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
item.__isDown = false;
|
if(!item.interactiveChildren)up = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(item.__isDown)
|
||||||
|
{
|
||||||
|
if(item.mouseupoutside)item.mouseupoutside(this.mouse);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
item.__isDown = false;
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue