mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[calculation] Do not memoize the expression layouts but the expressions
final height to avoid overflowing the heap. The expression layouts are kept in the cell which are fewer then the number of calculations
This commit is contained in:
committed by
EmilieNumworks
parent
a67f422ab7
commit
1108ef21db
@@ -158,17 +158,8 @@ KDCoordinate HistoryController::rowHeight(int j) {
|
||||
return 0;
|
||||
}
|
||||
Calculation * calculation = m_calculationStore->calculationAtIndex(j);
|
||||
KDCoordinate inputHeight = calculation->inputLayout()->size().height();
|
||||
App * calculationApp = (App *)app();
|
||||
Poincare::ExpressionLayout * approximateLayout = calculation->approximateOutputLayout(calculationApp->localContext());
|
||||
KDCoordinate approximateOutputHeight = approximateLayout->size().height();
|
||||
if (calculation->shouldOnlyDisplayApproximateOutput(calculationApp->localContext())) {
|
||||
return inputHeight + approximateOutputHeight + 3*HistoryViewCell::k_digitVerticalMargin;
|
||||
}
|
||||
Poincare::ExpressionLayout * exactLayout = calculation->exactOutputLayout(calculationApp->localContext());
|
||||
KDCoordinate exactOutputHeight = exactLayout->size().height();
|
||||
KDCoordinate outputHeight = max(exactLayout->baseline(), approximateLayout->baseline()) + max(exactOutputHeight-exactLayout->baseline(), approximateOutputHeight-approximateLayout->baseline());
|
||||
return inputHeight + outputHeight + 3*HistoryViewCell::k_digitVerticalMargin;
|
||||
return calculation->height(calculationApp->localContext()) + 3*HistoryViewCell::k_digitVerticalMargin;
|
||||
}
|
||||
|
||||
KDCoordinate HistoryController::cumulatedHeightFromIndex(int j) {
|
||||
|
||||
Reference in New Issue
Block a user