mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-25 00:30:46 +01:00
[escher] TableView::cellAtLocation should return nullptr if the cell is
invisible and therefore no view displays it. Fix bug: add 4 functions, in the values table one cell is wrong as soon as you edit an x value
This commit is contained in:
committed by
LeaNumworks
parent
f30df04dba
commit
55be86ef50
@@ -98,7 +98,10 @@ void TableView::ContentView::scrollToCell(int x, int y) const {
|
||||
}
|
||||
|
||||
void TableView::ContentView::reloadCellAtLocation(int i, int j) {
|
||||
m_dataSource->willDisplayCellAtLocation(cellAtLocation(i, j), i, j);
|
||||
HighlightCell * cell = cellAtLocation(i, j);
|
||||
if (cell) {
|
||||
m_dataSource->willDisplayCellAtLocation(cellAtLocation(i, j), i, j);
|
||||
}
|
||||
}
|
||||
|
||||
int TableView::ContentView::typeOfSubviewAtIndex(int index) const {
|
||||
@@ -123,6 +126,9 @@ 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()) {
|
||||
return nullptr;
|
||||
}
|
||||
int type = m_dataSource->typeAtLocation(x, y);
|
||||
int index = relativeY*numberOfDisplayableColumns()+relativeX;
|
||||
int typeIndex = typeIndexFromSubviewIndex(index, type);
|
||||
|
||||
Reference in New Issue
Block a user