mirror of
https://github.com/geode-sdk/geode.git
synced 2025-04-16 06:55:04 -04:00
fix input nodes being clickable when invisible
This commit is contained in:
parent
3b7621c8a0
commit
bf43946daf
1 changed files with 5 additions and 0 deletions
|
@ -16,6 +16,11 @@ struct TextInputNodeFix : Modify<TextInputNodeFix, CCTextInputNode> {
|
|||
bool ccTouchBegan(cocos2d::CCTouch* touch, cocos2d::CCEvent* event) {
|
||||
if (this->getTag() != INPUT_TAG) return CCTextInputNode::ccTouchBegan(touch, event);
|
||||
|
||||
if (!this->isVisible()) {
|
||||
this->onClickTrackNode(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
auto const touchPos = touch->getLocation();
|
||||
auto const size = this->getContentSize();
|
||||
auto const pos = this->convertToNodeSpace(touchPos) + m_textField->getAnchorPoint() * size;
|
||||
|
|
Loading…
Add table
Reference in a new issue