| 107 | } |
| 108 | |
| 109 | Node* Menu::itemForTouch(Touch* touch) { |
| 110 | Vec2 worldLocation = this->convertToWorldSpace(touch->getLocation()); |
| 111 | if (_children && !_children->isEmpty()) { |
| 112 | for (int i = s_cast<int>(_children->getCount()) - 1; i >= 0; i--) { |
| 113 | Node* childItem = _children->get(i)->to<Node>(); |
| 114 | if (childItem && childItem->isVisible() && childItem->isTouchEnabled()) { |
| 115 | Vec2 local = childItem->convertToNodeSpace(worldLocation); |
| 116 | if (Rect(Vec2::zero, childItem->getSize()).containsPoint(local)) { |
| 117 | return getTouchedItem(childItem, worldLocation); |
| 118 | } |
| 119 | } |
| 120 | } |
| 121 | } |
| 122 | return nullptr; |
| 123 | } |
| 124 | |
| 125 | NS_DORA_END |
nothing calls this directly
no test coverage detected