mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-20 14:20:39 +01:00
[escher] TableViewDataSource: implement default cumulatedWidthFromIndex,
cumulatedWidthFromIndex, indexFromCumulatedWidth, indexFromCumulatedHeight
This commit is contained in:
@@ -209,23 +209,6 @@ KDCoordinate SolutionsController::rowHeight(int j) {
|
||||
return layoutHeight+ScrollableExactApproximateExpressionsCell::k_margin*2;
|
||||
}
|
||||
|
||||
KDCoordinate SolutionsController::cumulatedHeightFromIndex(int j) {
|
||||
int result = 0;
|
||||
for (int k = 0; k < j; k++) {
|
||||
result += rowHeight(k);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int SolutionsController::indexFromCumulatedHeight(KDCoordinate offsetY) {
|
||||
int result = 0;
|
||||
int j = 0;
|
||||
while (result < offsetY && j < numberOfRows()) {
|
||||
result += rowHeight(j++);
|
||||
}
|
||||
return (result < offsetY || offsetY == 0) ? j : j - 1;
|
||||
}
|
||||
|
||||
KDCoordinate SolutionsController::cumulatedWidthFromIndex(int i) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
|
||||
Reference in New Issue
Block a user