[apps/calculation] Calculation: invalid heights memoization when forcing the

display output
This commit is contained in:
Émilie Feral
2020-02-20 10:40:50 +01:00
committed by LeaNumworks
parent a2a47bb8ae
commit c3d8e09ceb
2 changed files with 7 additions and 1 deletions

View File

@@ -274,6 +274,12 @@ Calculation::DisplayOutput Calculation::displayOutput(Context * context) {
return m_displayOutput;
}
void Calculation::forceDisplayOutput(DisplayOutput d) {
m_displayOutput = d;
// Reset heights memoization as it might have changed when we modify the display output
m_height = -1;
m_expandedHeight = -1;
}
bool Calculation::shouldOnlyDisplayExactOutput() {
/* If the input is a "store in a function", do not display the approximate
* result. This prevents x->f(x) from displaying x = undef. */