| 350 | } |
| 351 | |
| 352 | ssize_t TableView::_indexFromOffset(Vec2 offset) |
| 353 | { |
| 354 | ssize_t index = 0; |
| 355 | const auto maxIdx = _dataSource->numberOfCellsInTableView(this) - 1; |
| 356 | |
| 357 | if (_vordering == VerticalFillOrder::TOP_DOWN) |
| 358 | { |
| 359 | offset.y = this->getContainer()->getContentSize().height - offset.y; |
| 360 | } |
| 361 | index = this->__indexFromOffset(offset); |
| 362 | if (index != -1) |
| 363 | { |
| 364 | index = MAX(0, index); |
| 365 | if (index > maxIdx) |
| 366 | { |
| 367 | index = AX_INVALID_INDEX; |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | return index; |
| 372 | } |
| 373 | |
| 374 | ssize_t TableView::__indexFromOffset(Vec2 offset) |
| 375 | { |
no test coverage detected