| 113 | } |
| 114 | |
| 115 | void KeyboardNotificationLayer::onTouchEnded(Touch* touch, Event* event) |
| 116 | { |
| 117 | if (!_trackNode) |
| 118 | { |
| 119 | return; |
| 120 | } |
| 121 | |
| 122 | auto endPos = touch->getLocation(); |
| 123 | |
| 124 | float delta = 5.0f; |
| 125 | if (std::abs(endPos.x - _beginPos.x) > delta || std::abs(endPos.y - _beginPos.y) > delta) |
| 126 | { |
| 127 | // not click |
| 128 | _beginPos.x = _beginPos.y = -1; |
| 129 | return; |
| 130 | } |
| 131 | |
| 132 | // decide the trackNode is clicked. |
| 133 | Rect rect; |
| 134 | rect.size = _trackNode->getContentSize(); |
| 135 | auto clicked = |
| 136 | isScreenPointInRect(endPos, Camera::getVisitingCamera(), _trackNode->getWorldToNodeTransform(), rect, nullptr); |
| 137 | this->onClickTrackNode(clicked, endPos); |
| 138 | AXLOGD("----------------------------------"); |
| 139 | } |
| 140 | |
| 141 | ////////////////////////////////////////////////////////////////////////// |
| 142 | // implement TextFieldTTFDefaultTest |
nothing calls this directly
no test coverage detected