mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-25 16:50:50 +01:00
[escher] TableViewDataSource: implement default cumulatedWidthFromIndex,
cumulatedWidthFromIndex, indexFromCumulatedWidth, indexFromCumulatedHeight
This commit is contained in:
@@ -132,23 +132,6 @@ KDCoordinate CalculationController::rowHeight(int j) {
|
||||
return ResponderImageCell::k_oneCellHeight;
|
||||
}
|
||||
|
||||
KDCoordinate CalculationController::cumulatedWidthFromIndex(int j) {
|
||||
int result = 0;
|
||||
for (int k = 0; k < j; k++) {
|
||||
result += columnWidth(k);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int CalculationController::indexFromCumulatedWidth(KDCoordinate offsetX) {
|
||||
int result = 0;
|
||||
int i = 0;
|
||||
while (result < offsetX && i < numberOfColumns()) {
|
||||
result += columnWidth(i++);
|
||||
}
|
||||
return (result < offsetX || offsetX == 0) ? i : i - 1;
|
||||
}
|
||||
|
||||
KDCoordinate CalculationController::cumulatedHeightFromIndex(int j) {
|
||||
return rowHeight(0) * j;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user