mirror of https://github.com/axmolengine/axmol.git
Merge pull request #2207 from csy1988525/master
fixed a bug when button's parent is hided, the button still can responce to clicked event
This commit is contained in:
commit
5f57ec2d1b
|
@ -638,6 +638,14 @@ bool CCControlButton::ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent)
|
|||
return false;
|
||||
}
|
||||
|
||||
for (CCNode *c = this->m_pParent; c != NULL; c = c->getParent())
|
||||
{
|
||||
if (c->isVisible() == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
m_isPushed = true;
|
||||
this->setHighlighted(true);
|
||||
sendActionsForControlEvents(CCControlEventTouchDown);
|
||||
|
|
Loading…
Reference in New Issue