[apps/calculation] Fix calculation height computation

It was done in two places before, which created inconsistencies
This commit is contained in:
Léa Saviot
2020-05-26 17:23:06 +02:00
committed by EmilieNumworks
parent 0379327b06
commit a56a73b0ba
12 changed files with 141 additions and 178 deletions

View File

@@ -206,13 +206,13 @@ KDCoordinate HistoryController::rowHeight(int j) {
return 0;
}
Shared::ExpiringPointer<Calculation> calculation = calculationAtIndex(j);
return calculation->height(
App::app()->localContext(),
HistoryViewCell::k_margin,
HistoryViewCell::k_inputOutputViewsVerticalMargin,
j == selectedRow() && selectedSubviewType() == SubviewType::Output,
false,
&HistoryViewCell::LayoutsCanBeSingleLine);
bool expanded = j == selectedRow() && selectedSubviewType() == SubviewType::Output;
KDCoordinate result = calculation->memoizedHeight(expanded);
if (result < 0) {
result = HistoryViewCell::Height(calculation.pointer(), expanded);
calculation->setMemoizedHeight(expanded, result);
}
return result;
}
int HistoryController::typeAtLocation(int i, int j) {