[escher] TableView: cellAtLocation returns nullptr if the cell is not

currently displayed
This commit is contained in:
Émilie Feral
2019-10-07 13:40:09 +02:00
committed by LeaNumworks
parent 19921ec125
commit 770f0971d7

View File

@@ -125,7 +125,7 @@ int TableView::ContentView::typeIndexFromSubviewIndex(int index, int type) const
HighlightCell * TableView::ContentView::cellAtLocation(int x, int y) {
int relativeX = x-columnsScrollingOffset();
int relativeY = y-rowsScrollingOffset();
if (relativeY >= numberOfDisplayableRows() || relativeX >= numberOfDisplayableColumns()) {
if (relativeY < 0 || relativeY >= numberOfDisplayableRows() || relativeX < 0 || relativeX >= numberOfDisplayableColumns()) {
return nullptr;
}
int type = m_dataSource->typeAtLocation(x, y);